diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-09 18:57:27 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-09 18:57:27 +0000 |
commit | 6e114371296d849132e538817a16877866fa84f3 (patch) | |
tree | bd4fa48fb15a2c9a6705f68c1733275cec5ef26c /src/map.h | |
parent | 579969a548e37bb631d3f79a5d420e577e022630 (diff) | |
download | mana-6e114371296d849132e538817a16877866fa84f3.tar.gz mana-6e114371296d849132e538817a16877866fa84f3.tar.bz2 mana-6e114371296d849132e538817a16877866fa84f3.tar.xz mana-6e114371296d849132e538817a16877866fa84f3.zip |
More of a start on pathfinding, but still just a start.
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -30,9 +30,15 @@ #define TILE_WALKABLE 1 #define TILE_ANIMATED 2 +/** + * A tile on a tile map. + */ class Tile { public: + /** + * Constructor. + */ Tile(); // Tile data @@ -45,6 +51,29 @@ class Tile int parentX, parentY; }; +/** + * A location on a tile map. Used for pathfinding, open list. + */ +class Location +{ + public: + /** + * Constructor. + */ + Location(int x, int y, Tile *tile); + + /** + * Comparison operator. + */ + bool operator< (const Location &loc) const; + + int x, y; + Tile *tile; +}; + +/** + * A tile map. + */ class Map { public: @@ -106,6 +135,9 @@ class Map private: int width, height; Tile *tiles; + + // Pathfinding members + int onClosedList, onOpenList; }; extern Map tiledMap; |