#include <thing.hpp>
Public Member Functions | |
Thing (ThingType type, MapComposite *map=NULL) | |
Constructor. | |
ThingType | getType () const |
Gets type of this thing. | |
bool | isVisible () const |
Returns whether this thing is visible on the map or not. | |
bool | canMove () const |
Returns whether this thing can move on the map or not. | |
bool | canFight () const |
Returns whether this thing can fight or not. | |
virtual void | update ()=0 |
Updates the internal status. | |
MapComposite * | getMap () const |
Gets the map this thing is located on. | |
virtual void | setMap (MapComposite *map) |
Sets the map this thing is located on. | |
void | addListener (const EventListener *) |
Adds a new listener. | |
void | removeListener (const EventListener *) |
Removes an existing listener. | |
virtual void | inserted () |
Calls all the "inserted" listeners. | |
virtual void | removed () |
Calls all the "removed" listeners. | |
Protected Types | |
typedef std::set< const EventListener * > | Listeners |
Protected Attributes | |
Listeners | mListeners |
List of event listeners. |
Knows only its type and the map it resides on. Provides listeners.
Definition at line 50 of file thing.hpp.
ThingType Thing::getType | ( | void | ) | const [inline] |
Gets type of this thing.
Definition at line 68 of file thing.hpp.
Referenced by Monster::damage(), Monster::forgetTarget(), Being::performAttack(), GameHandler::processMessage(), MapComposite::remove(), and AccountConnection::sendStatistics().
bool Thing::isVisible | ( | ) | const [inline] |
Returns whether this thing is visible on the map or not.
(Actor)
Definition at line 74 of file thing.hpp.
Referenced by MapComposite::insert(), and MapComposite::remove().
bool Thing::canMove | ( | ) | const [inline] |
Returns whether this thing can move on the map or not.
(Actor)
Definition at line 80 of file thing.hpp.
Referenced by MapComposite::insert(), and MapComposite::remove().
bool Thing::canFight | ( | ) | const [inline] |
Listeners Thing::mListeners [protected] |
List of event listeners.
Definition at line 129 of file thing.hpp.
Referenced by addListener(), Being::died(), Character::disconnected(), inserted(), removed(), and removeListener().