]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Tile.h
implemented map tile anmation
[l2e.git] / src / map / Tile.h
index d21de56d25fe2afbdacdc8a4735a06550dd8aaf1..34481f315e01119af4ff50fbc2c9ee670a6f274d 100644 (file)
@@ -1,14 +1,7 @@
-/*
- * Tile.h
- *
- *  Created on: Sep 29, 2012
- *      Author: holy
- */
-
 #ifndef MAP_TILE_H_
 #define MAP_TILE_H_
 
-#include "../geometry/Vector.h"
+#include "../math/Vector.h"
 
 #include <SDL.h>
 
@@ -16,6 +9,9 @@ namespace map {
 
 class Tile {
 
+public:
+       static const int TYPE_ID = 603;
+
 public:
        Tile();
        ~Tile() { }
@@ -26,26 +22,38 @@ public:
                BLOCK_EAST = 0x02,
                BLOCK_SOUTH = 0x04,
                BLOCK_WEST = 0x08,
+               LADDER = 0x10,
        };
 
-       const geometry::Vector<int> &Offset() const { return offset; }
+       SDL_Surface *BattleBackground() { return battlebg; }
+
+       const math::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; }
 
+       bool IsLadder() const { return flags & LADDER; }
+
+       int NumFrames() const { return frames; }
+
+       static void CreateTypeDescription();
+       static void Construct(void *);
+
 // temporary setters
 public:
-       void SetOffset(const geometry::Vector<int> &o) { offset = o; }
-       void SetFlags(Uint32 f) { flags = f; }
+       Tile &SetOffset(const math::Vector<int> &o) { offset = o; return *this; }
+       Tile &SetFlags(Uint32 f) { flags = f; return *this; }
 
 private:
-       geometry::Vector<int> offset;
-       Uint32 flags;
+       SDL_Surface *battlebg;
+       math::Vector<int> offset;
+       int flags;
+       int frames;
 
 };
 
 }
 
-#endif /* MAP_TILE_H_ */
+#endif