IGameObject Class Reference

#include <IGameObject.h>

Inheritance diagram for IGameObject:

IMoveableObject Char List of all members.

Public Member Functions

 IGameObject (Uint32 serial, Uint16 type)
virtual ~IGameObject ()
Uint32 getSerial ()
Uint16 getType ()
Uint32 getOwner ()
void setOwner (Uint32 newOwner)
std::string getName ()
void setName (std::string newName)
const LocationgetPosition ()
void setPosition (const Location &newPos)
void setPosition (Location *newPos)
virtual void update ()=0

Private Attributes

Uint32 mSerial
Uint16 mType
Uint32 mOwner
std::string mName
Location mPos

Detailed Description

This abstract interface represents a generic game object. It is used as a base class for all the items, obects and beings of the game.

Definition at line 16 of file IGameObject.h.


Constructor & Destructor Documentation

IGameObject::IGameObject Uint32  serial,
Uint16  type
 

Creates a new objects given its serial number (unique) and its type.

Definition at line 5 of file IGameObject.cpp.

00006     :mSerial(serial),
00007     mType(type),
00008     mOwner(0),
00009     mName("Generic Object"),
00010     mPos(Location())
00011 {
00012     //ctor
00013 }

IGameObject::~IGameObject  )  [virtual]
 

Virtual destructor.

Definition at line 15 of file IGameObject.cpp.

00016 {
00017 
00018 }


Member Function Documentation

std::string IGameObject::getName  )  [inline]
 

Returns object's name. Derived classes may implement more specializated names categories.

Author:
stonedz
Since:
pre-alpha
Returns:
Object's standard name.

Definition at line 73 of file IGameObject.h.

00073 {return mName;}

Uint32 IGameObject::getOwner  )  [inline]
 

Returns object's owner.

Author:
stonedz
Since:
pre-alpha
Returns:
Object's owner serial.

Definition at line 54 of file IGameObject.h.

00054 {return mOwner;}

const Location& IGameObject::getPosition  )  [inline]
 

Returns a constant reference to the current position of the object in the form of a Location instance.

Author:
stonedz
Since:
pre-alpha
Returns:
Object position.
See also:
Location

Definition at line 93 of file IGameObject.h.

Referenced by IMoveableObject::move().

00093 {return mPos;}

Uint32 IGameObject::getSerial  )  [inline]
 

Returns object's serial.

Author:
stonedz
Since:
pre-alpha
Returns:
Object's serial unique number.

Definition at line 36 of file IGameObject.h.

00036 {return mSerial;}

Uint16 IGameObject::getType  )  [inline]
 

Returns object type.

Author:
stonedz
Since:
pre-alpha
Returns:
Object type.

Definition at line 45 of file IGameObject.h.

00045 {return mType;}

void IGameObject::setName std::string  newName  ) 
 

Sets a new name for the object.

Author:
stonedz
Since:
pre-alpha
Parameters:
newName The string containing the new object's name.

Definition at line 24 of file IGameObject.cpp.

References mName.

Referenced by Char::Char().

00024                                           {
00025     mName = newName;
00026 }

void IGameObject::setOwner Uint32  newOwner  ) 
 

Sets current object's owner.

Author:
stonedz
Since:
pre-alpha
Parameters:
newOwner The serial of the new owner.

Definition at line 20 of file IGameObject.cpp.

References mOwner.

00020                                          {
00021     mOwner = newOwner;
00022 }

void IGameObject::setPosition Location newPos  )  [inline]
 

Sets the current position of the object with a Location object pointer.

Author:
stonedz
Since:
pre-alpha
Parameters:
newPos Object's new position.

Definition at line 111 of file IGameObject.h.

00111 {mPos = *newPos;}

void IGameObject::setPosition const Location newPos  )  [inline]
 

Sets the current position of the object with a Location object reference.

Author:
stonedz
Since:
pre-alpha
Parameters:
newPos Object's new position.

Definition at line 102 of file IGameObject.h.

Referenced by Char::Char(), and IMoveableObject::move().

00102 {mPos = newPos;}

virtual void IGameObject::update  )  [pure virtual]
 

Updates the object properties. Each derivate class must implement it in order to be usable.

Implemented in Char.


Member Data Documentation

std::string IGameObject::mName [private]
 

Standard object's name.

Definition at line 124 of file IGameObject.h.

Referenced by setName().

Uint32 IGameObject::mOwner [private]
 

If != 0 is the owner's serial.

Definition at line 123 of file IGameObject.h.

Referenced by setOwner().

Location IGameObject::mPos [private]
 

Object's location (position).

Definition at line 125 of file IGameObject.h.

Uint32 IGameObject::mSerial [private]
 

Unique object's serial.

Definition at line 121 of file IGameObject.h.

Uint16 IGameObject::mType [private]
 

Object type.

Definition at line 122 of file IGameObject.h.


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