IMoveableObject Class Reference

#include <IMoveableObject.h>

Inheritance diagram for IMoveableObject:

IGameObject Char List of all members.

Public Member Functions

 IMoveableObject (Uint32 serial, Uint16 type)
virtual ~IMoveableObject ()
void setDestination (Location *dest)
void setDestination (const Location &dest)
void move ()

Private Attributes

Location mDestPos

Detailed Description

Abstract interface for moveable objects (items, NPC, PC).

Definition at line 9 of file IMoveableObject.h.


Constructor & Destructor Documentation

IMoveableObject::IMoveableObject Uint32  serial,
Uint16  type
 

Cosntructor

Definition at line 4 of file IMoveableObject.cpp.

00005     :IGameObject(serial, type),
00006     mDestPos(Location())
00007 {
00008     //ctor
00009 }

IMoveableObject::~IMoveableObject  )  [virtual]
 

Virtual destructor.

Definition at line 11 of file IMoveableObject.cpp.

00012 {
00013     //dtor
00014 }


Member Function Documentation

void IMoveableObject::move  ) 
 

Moves the object towards its destination.

Todo:
Temporary implementation, teleports to the destination Location
See also:
mDestPos

Definition at line 16 of file IMoveableObject.cpp.

References IGameObject::getPosition(), mDestPos, and IGameObject::setPosition().

00016                           {
00017     if (mDestPos != getPosition())
00018         setPosition(mDestPos); // Teletransport ! not for production use :D
00019 }

void IMoveableObject::setDestination const Location dest  )  [inline]
 

Sets the destination position with a Location object reference.

Author:
stonedz
Since:
pre-alpha
Parameters:
dest The new object's destination.

Definition at line 38 of file IMoveableObject.h.

References mDestPos.

00038 {mDestPos = dest;}

void IMoveableObject::setDestination Location dest  )  [inline]
 

Sets the destination position with a Location object pointer.

Author:
stonedz
Since:
pre-alpha
Parameters:
dest The new object's destination.

Definition at line 29 of file IMoveableObject.h.

References mDestPos.

00029 {mDestPos = *dest;}


Member Data Documentation

Location IMoveableObject::mDestPos [private]
 

Where am I going to?

Definition at line 50 of file IMoveableObject.h.

Referenced by move(), and setDestination().


The documentation for this class was generated from the following files:
Generated on Mon Dec 3 04:30:13 2007 for lo-testserver by  doxygen 1.3.9.1