1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/********************************************************************
*
*	File:		fsILayer.h
*
*	Purpose:	Interface to a tile map layer which can be normal
*				tiles or object groups
*
*********************************************************************/

#ifndef fsILayerhdr
#define fsILayerhdr

#include <vector>
#include <fsCore/fsBaseTypes.h>
#include <fsCore/fsStr.h>
#include <fsCore/fsPoint.h>

#include "fsTileMapForward.h"

namespace fsNTileMap
{
	class fsILayer
	{
	public:

		enum class eType
		{
			UNKNOWN,
			TILE,
			OBJECT,
			IMAGE
		};

		eType typeGet() const;

		virtual std::vector<fsIObjectRef> objectsGet() const = 0;
		virtual fsIObjectRef objectGet(const fsStr& pName) const = 0;
		virtual fsITileRef tileGet(fsS32 pX, fsS32 pY) const = 0;

		/// Path (relative to the map) of an IMAGE layer's backdrop/parallax image.
		virtual fsStr imagePathGet() const = 0;

		/// Authored layer offset in map pixels (Tiled offsetx/offsety, or x/y).
		virtual fsPoint layerOffsetGet() const = 0;

		virtual fsStr nameGet() const = 0;

		virtual ~fsILayer() = default;

	protected:

		fsILayer() = default;

		eType mType;

	private:

	};
}

#endif