]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Tile.h
added basic map classes
[l2e.git] / src / map / Tile.h
diff --git a/src/map/Tile.h b/src/map/Tile.h
new file mode 100644 (file)
index 0000000..d21de56
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Tile.h
+ *
+ *  Created on: Sep 29, 2012
+ *      Author: holy
+ */
+
+#ifndef MAP_TILE_H_
+#define MAP_TILE_H_
+
+#include "../geometry/Vector.h"
+
+#include <SDL.h>
+
+namespace map {
+
+class Tile {
+
+public:
+       Tile();
+       ~Tile() { }
+
+public:
+       enum Flag {
+               BLOCK_NORTH = 0x01,
+               BLOCK_EAST = 0x02,
+               BLOCK_SOUTH = 0x04,
+               BLOCK_WEST = 0x08,
+       };
+
+       const geometry::Vector<int> &Offset() const { return offset; }
+
+       bool BlocksNorth() const { return flags & BLOCK_NORTH; }
+       bool BlocksEast() const { return flags & BLOCK_EAST; }
+       bool BlocksSouth() const { return flags & BLOCK_SOUTH; }
+       bool BlocksWest() const { return flags & BLOCK_WEST; }
+
+// temporary setters
+public:
+       void SetOffset(const geometry::Vector<int> &o) { offset = o; }
+       void SetFlags(Uint32 f) { flags = f; }
+
+private:
+       geometry::Vector<int> offset;
+       Uint32 flags;
+
+};
+
+}
+
+#endif /* MAP_TILE_H_ */