IGameObject

An interface for all game objects.  Any object in the game must have certain properties.  These properties include: having flags that indicate how the object should be drawn, a way to modify those flags, an ID for selection, coordinates in world space, a rotation, and any color that should be applied to the object.

Project

ModelCore

Include

IGameObject.h

Summary
An interface for all game objects.
The IGameObject destructor.
Standard draw flags for a game object.
Clones the IGameObject.
Resets the class name of the IGameObject.
Resets the display flags.
Reports if a specific display flag is set.
Reports if a custom display flag is set.
Turns a specific display flag on.
Turns a custom display flag on.
Provides the ID of the object.
Sets the ID of the object.
Provides the coordinates of the object.
Sets the coordinates of the object.
Provides the rotation of the object.
Sets the rotation of the object.
Provides the color of the object.
Sets the color of the object.
Loads an IGameObject from an input stream.
Writes an IGameObject to an output stream.

Public

Summary
The IGameObject destructor.
Standard draw flags for a game object.
Clones the IGameObject.
Resets the class name of the IGameObject.
Resets the display flags.
Reports if a specific display flag is set.
Reports if a custom display flag is set.
Turns a specific display flag on.
Turns a custom display flag on.
Provides the ID of the object.
Sets the ID of the object.
Provides the coordinates of the object.
Sets the coordinates of the object.
Provides the rotation of the object.
Sets the rotation of the object.
Provides the color of the object.
Sets the color of the object.
Loads an IGameObject from an input stream.
Writes an IGameObject to an output stream.

Destructor

~IGameObject

virtual ~IGameObject()=0

The IGameObject destructor.  It is pure virtual because this class must be derived from to be used.

Enumerations

ObjectFlag

Standard draw flags for a game object.  Available draw flags include: Dim (dims the object), Outline (draws the object with an outline), Select (allows the object to be selected), Hidden (shows/hides the object).

Pure Virtual Functions

Clone

virtual IGameObject *Clone()=0

Clones the IGameObject.

Returns

A pointer to a new instance of the object.

name

virtual wxString name()=0

Resets the class name of the IGameObject.

Returns

A const reference to a string containing the class name of the IGameObject.

reset

virtual void reset()=0

Resets the display flags.

isset

virtual bool isset(const ObjectFlag flag) const=0

Reports if a specific display flag is set.

Parameters

flagThe display flag being checked.

Returns

A boolean value saying whether the flag is set.  The value is true if the flag is set.

isset

virtual bool isset(const wxInt32 flag) const=0

Reports if a custom display flag is set.

Returns

A boolean value saying whether the flag is set.  The value is true if the flag is set.

set

virtual void set(const ObjectFlag flag)=0

Turns a specific display flag on.

Parameters

flagThe display flag to turn on.

set

virtual void set(const wxInt32 flag)=0

Turns a custom display flag on.

Parameters

flagThe display flag to turn on.

id

virtual wxInt32 id() const=0

Provides the ID of the object.

Returns

The ID of the object.

id

virtual void id(const wxInt32 id)=0

Sets the ID of the object.

Parameters

idThe new ID.

coords

virtual const Vector &coords() const=0

Provides the coordinates of the object.

Returns

The coordinates of the object.

coords

virtual void coords(const Vector &coords)=0

Sets the coordinates of the object.

Parameters

coordsThe new coordinates.

rotation

virtual float rotation() const=0

Provides the rotation of the object.

Returns

The rotation of the object.

rotation

virtual void rotation(const float val)=0

Sets the rotation of the object.

Parameters

valThe new rotation.

color

virtual ColorType color() const=0

Provides the color of the object.

Returns

The color of the object.

color

virtual void color(const ColorType color)=0

Sets the color of the object.

Parameters

colorThe new color.

load

virtual void load(wxDataInputStream &stream)=0

Loads an IGameObject from an input stream.

Parameters

streamThe input stream.

save

virtual void save(wxDataOutputStream &stream) const=0

Writes an IGameObject to an output stream.

Parameters

streamThe output stream.
virtual ~IGameObject()=0
The IGameObject destructor.
virtual IGameObject *Clone()=0
Clones the IGameObject.
An interface for all game objects.
virtual wxString name()=0
Resets the class name of the IGameObject.
virtual void reset()=0
Resets the display flags.
virtual bool isset(const ObjectFlag flag) const=0
Reports if a specific display flag is set.
virtual void set(const ObjectFlag flag)=0
Turns a specific display flag on.
virtual wxInt32 id() const=0
Provides the ID of the object.
virtual const Vector &coords() const=0
Provides the coordinates of the object.
virtual float rotation() const=0
Provides the rotation of the object.
virtual ColorType color() const=0
Provides the color of the object.
virtual void load(wxDataInputStream &stream)=0
Loads an IGameObject from an input stream.
virtual void save(wxDataOutputStream &stream) const=0
Writes an IGameObject to an output stream.
ModelCore provides all of the data classes and associated helper classes and functions required to represent a complete game.