MovingObject Class Reference

#include <movingobject.hpp>

Inheritance diagram for MovingObject:

Object Thing Being Character Monster List of all members.

Detailed Description

Base class for in-game moving objects.

This class adds a sense of direction, destination and size.

Definition at line 35 of file movingobject.hpp.

Public Member Functions

 MovingObject (int type, int id)
 Proxy constructor.
Point const & getDestination () const
 Gets the destination coordinates of the object.
void setDestination (const Point &dst)
 Sets the destination coordinates of the object.
Point getOldPosition () const
 Gets the old coordinates of the object.
void setDirection (int direction)
 Sets object direction.
unsigned char getDirection () const
 Gets object direction.
void setSpeed (unsigned s)
 Sets object speed.
void setSize (unsigned s)
 Sets object bounding circle radius.
unsigned getSize ()
 Gets object bounding circle radius.
virtual void move ()
 Moves the object toward its destination.
int getPublicID () const
 Get public ID.
void setPublicID (int id)
 Set public ID.

Protected Attributes

unsigned char mDirection
 Facing direction.
unsigned short mActionTime
 Delay until next action.
unsigned mSize
 Radius of bounding circle.

Private Attributes

unsigned short mPublicID
 Object ID sent to clients (unique with respect to the map).
Point mDst
 Target coordinates.
Point mOld
 Old coordinates.
unsigned short mSpeed
 Speed.
std::list< PATH_NODEmPath


Constructor & Destructor Documentation

MovingObject::MovingObject int  type,
int  id
[inline]
 

Proxy constructor.

Definition at line 41 of file movingobject.hpp.


Member Function Documentation

Point const& MovingObject::getDestination  )  const [inline]
 

Gets the destination coordinates of the object.

Definition at line 51 of file movingobject.hpp.

unsigned char MovingObject::getDirection  )  const [inline]
 

Gets object direction.

Definition at line 79 of file movingobject.hpp.

Point MovingObject::getOldPosition  )  const [inline]
 

Gets the old coordinates of the object.

Definition at line 67 of file movingobject.hpp.

int MovingObject::getPublicID  )  const [inline]
 

Get public ID.

Returns:
the public ID, 65535 if none yet.

Definition at line 110 of file movingobject.hpp.

unsigned MovingObject::getSize  )  [inline]
 

Gets object bounding circle radius.

Definition at line 97 of file movingobject.hpp.

void MovingObject::move  )  [virtual]
 

Moves the object toward its destination.

Reimplemented in Being.

Definition at line 27 of file movingobject.cpp.

void MovingObject::setDestination const Point dst  )  [inline]
 

Sets the destination coordinates of the object.

Definition at line 57 of file movingobject.hpp.

void MovingObject::setDirection int  direction  )  [inline]
 

Sets object direction.

Definition at line 73 of file movingobject.hpp.

void MovingObject::setPublicID int  id  )  [inline]
 

Set public ID.

The object shall not have any public ID yet.

Definition at line 116 of file movingobject.hpp.

void MovingObject::setSize unsigned  s  )  [inline]
 

Sets object bounding circle radius.

Definition at line 91 of file movingobject.hpp.

void MovingObject::setSpeed unsigned  s  )  [inline]
 

Sets object speed.

Definition at line 85 of file movingobject.hpp.


Member Data Documentation

unsigned short MovingObject::mActionTime [protected]
 

Delay until next action.

Definition at line 130 of file movingobject.hpp.

unsigned char MovingObject::mDirection [protected]
 

Facing direction.

Definition at line 129 of file movingobject.hpp.

Point MovingObject::mDst [private]
 

Target coordinates.

Definition at line 123 of file movingobject.hpp.

Point MovingObject::mOld [private]
 

Old coordinates.

Definition at line 124 of file movingobject.hpp.

std::list<PATH_NODE> MovingObject::mPath [private]
 

Definition at line 126 of file movingobject.hpp.

unsigned short MovingObject::mPublicID [private]
 

Object ID sent to clients (unique with respect to the map).

Definition at line 121 of file movingobject.hpp.

unsigned MovingObject::mSize [protected]
 

Radius of bounding circle.

Definition at line 131 of file movingobject.hpp.

unsigned short MovingObject::mSpeed [private]
 

Speed.

Definition at line 125 of file movingobject.hpp.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 15:39:18 2007 for TMW Server by  doxygen 1.3.9.1