diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-08 23:24:37 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-09 22:48:21 +0200 |
commit | 69d8407badcb703709534f5097b9b5697ac3404c (patch) | |
tree | 7a7e126b0ce0181f22397d62ca3d4e553482b439 /src/beingmanager.h | |
parent | 1158bce840bbd76a297c4f5eefd19444584f6fcd (diff) | |
download | mana-69d8407badcb703709534f5097b9b5697ac3404c.tar.gz mana-69d8407badcb703709534f5097b9b5697ac3404c.tar.bz2 mana-69d8407badcb703709534f5097b9b5697ac3404c.tar.xz mana-69d8407badcb703709534f5097b9b5697ac3404c.zip |
Made BeingManager methods const where appropriate
Diffstat (limited to 'src/beingmanager.h')
-rw-r--r-- | src/beingmanager.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/beingmanager.h b/src/beingmanager.h index 727918a8..0150f373 100644 --- a/src/beingmanager.h +++ b/src/beingmanager.h @@ -28,7 +28,6 @@ class LocalPlayer; class Map; typedef std::list<Being*> Beings; -typedef Beings::iterator BeingIterator; class BeingManager { @@ -38,12 +37,12 @@ class BeingManager ~BeingManager(); /** - * Sets the map on which beings are created + * Sets the map on which beings are created. */ void setMap(Map *map); /** - * Sets the current player + * Sets the current player. */ void setPlayer(LocalPlayer *player); @@ -60,13 +59,13 @@ class BeingManager /** * Returns a specific id Being. */ - Being *findBeing(int id); + Being *findBeing(int id) const; /** * Returns a being at specific coordinates. */ - Being *findBeing(int x, int y, Being::Type type = Being::UNKNOWN); - Being *findBeingByPixel(int x, int y); + Being *findBeing(int x, int y, Being::Type type = Being::UNKNOWN) const; + Being *findBeingByPixel(int x, int y) const; /** * Returns a being nearest to specific coordinates. @@ -78,13 +77,13 @@ class BeingManager * @param type The type of being to look for. */ Being *findNearestLivingBeing(int x, int y, int maxdist, - Being::Type type = Being::UNKNOWN); + Being::Type type = Being::UNKNOWN) const; /** * Finds a being by name and (optionally) by type. */ Being *findBeingByName(const std::string &name, - Being::Type type = Being::UNKNOWN); + Being::Type type = Being::UNKNOWN) const; /** * Returns a being nearest to another being. @@ -93,12 +92,12 @@ class BeingManager * no being is returned */ Being *findNearestLivingBeing(Being *aroundBeing, int maxdist, - Being::Type type = Being::UNKNOWN); + Being::Type type = Being::UNKNOWN) const; /** - * Returns the whole list of beings + * Returns the whole list of beings. */ - Beings &getAll(); + const Beings &getAll() const; /** * Returns true if the given being is in the manager's list, false @@ -109,7 +108,8 @@ class BeingManager bool hasBeing(Being *being) const; /** - * Logic. + * Performs being logic and deletes dead beings when they have been + * dead long enough. */ void logic(); |