diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-01-05 09:36:56 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-01-05 09:36:56 +0000 |
commit | e880b17081962580afea1d003600afffe062d427 (patch) | |
tree | 71caf8087ca1fd431c23ca259d3306d413126d84 | |
parent | 90290b7aaf2a55187598e67c31d33f5735f574ce (diff) | |
download | mana-client-e880b17081962580afea1d003600afffe062d427.tar.gz mana-client-e880b17081962580afea1d003600afffe062d427.tar.bz2 mana-client-e880b17081962580afea1d003600afffe062d427.tar.xz mana-client-e880b17081962580afea1d003600afffe062d427.zip |
Declared some methods const.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/map.cpp | 4 | ||||
-rw-r--r-- | src/map.h | 12 |
3 files changed, 12 insertions, 8 deletions
@@ -1,3 +1,7 @@ +2006-01-05 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/map.cpp, src/map.h: Declared some methods const. + 2007-01-03 Guillaume Melquiond <guillaume.melquiond@gmail.com> * src/resources/mapreader.cpp: Fixed memory leak on error. diff --git a/src/map.cpp b/src/map.cpp index 1bd8f235..ec4abc50 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -280,7 +280,7 @@ Map::setWalk(int x, int y, bool walkable) } bool -Map::getWalk(int x, int y) +Map::getWalk(int x, int y) const { return !tileCollides(x, y) && !occupied(x, y); } @@ -302,7 +302,7 @@ Map::occupied(int x, int y) } bool -Map::tileCollides(int x, int y) +Map::tileCollides(int x, int y) const { return !(contains(x, y) && mMetaTiles[x + y * mWidth].walkable); } @@ -136,36 +136,36 @@ class Map : public Properties /** * Tell if a tile is walkable or not, includes checking beings. */ - bool getWalk(int x, int y); + bool getWalk(int x, int y) const; /** * Tell if a tile collides, not including a check on beings. */ - bool tileCollides(int x, int y); + bool tileCollides(int x, int y) const; /** * Returns the width of this map. */ int - getWidth() { return mWidth; } + getWidth() const { return mWidth; } /** * Returns the height of this map. */ int - getHeight() { return mHeight; } + getHeight() const { return mHeight; } /** * Returns the tile width of this map. */ int - getTileWidth() { return mTileWidth; } + getTileWidth() const { return mTileWidth; } /** * Returns the tile height used by this map. */ int - getTileHeight() { return mTileHeight; } + getTileHeight() const { return mTileHeight; } /** * Find a path from one location to the next. |