diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-23 21:00:16 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-26 17:18:21 +0200 |
commit | e726c34606f85347e70a0deb6b180db03b6d0c25 (patch) | |
tree | e78e5ba07dd9484abed035cc3e63744101bbef57 /src/game-server/thing.hpp | |
parent | a3f72002fa02cd4c525f101c5f240a22d4480119 (diff) | |
download | manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.tar.gz manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.tar.bz2 manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.tar.xz manaserv-e726c34606f85347e70a0deb6b180db03b6d0c25.zip |
Merged MovingObject into the Being class
Also renamed Object to Actor, to make it sound a little less generic.
Cleans up a bit the rather big hierarchy of different object types we
have.
Diffstat (limited to 'src/game-server/thing.hpp')
-rw-r--r-- | src/game-server/thing.hpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/game-server/thing.hpp b/src/game-server/thing.hpp index 83c9da2a..b87ea657 100644 --- a/src/game-server/thing.hpp +++ b/src/game-server/thing.hpp @@ -27,9 +27,9 @@ class EventListener; class MapComposite; /** - * Object type enumeration. + * Types of things enumeration. */ -enum +enum ThingType { OBJECT_ITEM = 0, /**< A simple item. */ OBJECT_ACTOR, /**< An item that toggle map/quest actions (doors, @@ -53,14 +53,11 @@ class Thing /** * Constructor. */ - Thing(int type, MapComposite *map = NULL) + Thing(ThingType type, MapComposite *map = NULL) : mMap(map), mType(type) {} - /** - * Destructor. - */ virtual ~Thing(); /** @@ -68,17 +65,17 @@ class Thing * * @return the type of this thing. */ - int getType() const + ThingType getType() const { return mType; } /** - * Returns whether this thing is visible on the map or not. (Object) + * Returns whether this thing is visible on the map or not. (Actor) */ bool isVisible() const { return mType != OBJECT_OTHER; } /** - * Returns whether this thing can move on the map or not. (MovingObject) + * Returns whether this thing can move on the map or not. (Actor) */ bool canMove() const { return mType == OBJECT_CHARACTER || mType == OBJECT_MONSTER || @@ -93,8 +90,7 @@ class Thing /** * Updates the internal status. */ - virtual void - update() = 0; + virtual void update() = 0; /** * Gets the map this thing is located on. @@ -130,11 +126,11 @@ class Thing protected: typedef std::set< EventListener const * > Listeners; - Listeners mListeners; /**< List of event listeners. */ + Listeners mListeners; /**< List of event listeners. */ private: MapComposite *mMap; /**< Map the thing is on */ - char mType; /**< Type of this thing. */ + ThingType mType; /**< Type of this thing. */ }; #endif // _TMWSERV_THING_H_ |