Thing Class Reference

Base class for in-game objects. More...

#include <thing.hpp>

Inheritance diagram for Thing:

Actor SpawnArea Being Character Monster NPC

List of all members.

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.
MapCompositegetMap () 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.


Detailed Description

Base class for in-game objects.

Knows only its type and the map it resides on. Provides listeners.

Definition at line 50 of file thing.hpp.


Member Function Documentation

ThingType Thing::getType ( void   )  const [inline]

Gets type of this thing.

Returns:
the 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]

Returns whether this thing can fight or not.

(Being)

Definition at line 87 of file thing.hpp.


Member Data Documentation

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().


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:46 2009 for TMW Server Collection by  doxygen 1.5.5