From 69d8407badcb703709534f5097b9b5697ac3404c Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 8 Apr 2009 23:24:37 +0200 Subject: Made BeingManager methods const where appropriate --- src/beingmanager.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/beingmanager.h') 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 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(); -- cgit v1.2.3-70-g09d2