diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-12 15:40:23 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-12 15:40:23 +0000 |
commit | 3262d5319c5f2cc830b3b783880df4b1b5d95710 (patch) | |
tree | 4573e5097a54d35ff6937bd001a06ffe3f9146ae /src/map.h | |
parent | 3eca8915fd14dcebe88647a198bfce5d789a6efb (diff) | |
download | mana-3262d5319c5f2cc830b3b783880df4b1b5d95710.tar.gz mana-3262d5319c5f2cc830b3b783880df4b1b5d95710.tar.bz2 mana-3262d5319c5f2cc830b3b783880df4b1b5d95710.tar.xz mana-3262d5319c5f2cc830b3b783880df4b1b5d95710.zip |
Made pathfinding algorithm cope better with beings blocking the road. This is
done by allowing walking over other beings, but at an additional cost so that
it is preferable to walk around them.
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -129,7 +129,7 @@ class Map : public Properties MetaTile *getMetaTile(int x, int y); /** - * Set walkability flag for a tile + * Set walkability flag for a tile. */ void setWalk(int x, int y, bool walkable); @@ -199,6 +199,16 @@ class Map : public Properties Tileset* getTilesetWithGid(int gid); + /** + * Tells whether a tile is occupied by a being. + */ + bool occupied(int x, int y); + + /** + * Tells whether the given coordinates fall within the map boundaries. + */ + bool contains(int x, int y); + int mWidth, mHeight; int mTileWidth, mTileHeight; MetaTile *mMetaTiles; |