BaseTiledObject

Common base class for objects that lay on top of a tile.  A BaseTiledObject is created with a pointer to the tile on which it lays, and the tile can be directly queried to provide game information any derived class does not want to provide.  Derived classes may also provide their own special information that assists in drawing them on the screen.

Derived From

IGameObject

Project

ModelCore

Include

BaseTiledObject.h

Summary
Common base class for objects that lay on top of a tile.
Clones the PortObject.
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 BaseTiledObject.
Sets the ID of the BaseTiledObject.
Provides the coordinates of the BaseTiledObject.
Sets the coordinates of the BaseTiledObject.
Provides the color of the BaseTiledObject.
Sets the color of the BaseTiledObject.
Loads a BaseTiledObject from an input stream.
Writes a BaseTiledObject to an output stream.
The BaseTiledObject constructor.
The BaseTiledObject destructor.
The TileObject the chip lays upon, from which it draws its location, roll value, and id.
The object display flags.

Public

Summary
Clones the PortObject.
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 BaseTiledObject.
Sets the ID of the BaseTiledObject.
Provides the coordinates of the BaseTiledObject.
Sets the coordinates of the BaseTiledObject.
Provides the color of the BaseTiledObject.
Sets the color of the BaseTiledObject.
Loads a BaseTiledObject from an input stream.
Writes a BaseTiledObject to an output stream.

Virtual Functions

Clone

virtual IGameObject *Clone()

Clones the PortObject.  Unused.

Returns

A NULL pointer.

reset

virtual void reset()

Resets the display flags.

isset

virtual bool isset(const ObjectFlag flag) const

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

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)

Turns a specific display flag on.

Parameters

flagThe display flag to turn on.

set

virtual void set(const wxInt32 flag)

Turns a custom display flag on.

Parameters

flagThe display flag to turn on.

id

virtual wxInt32 id() const

Provides the ID of the BaseTiledObject.  The ID is retrieved from the TileObject.

Returns

The ID of the BaseTiledObject.

id

virtual void id(const wxInt32 id)

Sets the ID of the BaseTiledObject.  This function is not implemented.  It is only declared to satisfy the requirements of IGameObject.

Parameters

idThe new ID.

coords

virtual const Vector &coords() const

Provides the coordinates of the BaseTiledObject.  The coordinates are retrieved from the TileObject.

Returns

The coordinates of the BaseTiledObject.

coords

virtual void coords(const Vector &coords)

Sets the coordinates of the BaseTiledObject.  This function is not implemented.  It is only declared to satisfy the requirements of IGameObject.

Parameters

coordsThe new coordinates.

color

virtual ColorType color() const

Provides the color of the BaseTiledObject.  Since having a color on a BaseTiledObject is nonsensical, this function returns CR_SIZE, which is no color at all.

Returns

A nonsensical color value.

color

virtual void color(const ColorType color)

Sets the color of the BaseTiledObject.  This function is not implemented.  It is only declared to satisfy the requirements of IGameObject.

Parameters

colorThe new color.

load

virtual void load(wxDataInputStream &stream)

Loads a BaseTiledObject from an input stream.

Parameters

streamThe input stream.

save

virtual void save(wxDataOutputStream &stream) const

Writes a BaseTiledObject to an output stream.

Parameters

streamThe output stream.

Protected

Summary
The BaseTiledObject constructor.
The BaseTiledObject destructor.
The TileObject the chip lays upon, from which it draws its location, roll value, and id.

Constructors

BaseTiledObject

BaseTiledObject(const TileObject * const pTile)

The BaseTiledObject constructor.

Parameters

pTileA pointer to the TileObject the BaseTiledObject is built on and will refer to for game data.

Destructor

~BaseTiledObject

virtual ~BaseTiledObject()=0

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

Variables

mpTile

const TileObject * const mpTile

The TileObject the chip lays upon, from which it draws its location, roll value, and id.

Private

Summary
The object display flags.

Variables

mDisplayFlags

wxInt32 mDisplayFlags

The object display flags.

virtual IGameObject *Clone()
Clones the PortObject.
virtual void reset()
Resets the display flags.
virtual bool isset(const ObjectFlag flag) const
Reports if a specific display flag is set.
virtual void set(const ObjectFlag flag)
Turns a specific display flag on.
virtual wxInt32 id() const
Provides the ID of the BaseTiledObject.
virtual const Vector &coords() const
Provides the coordinates of the BaseTiledObject.
virtual ColorType color() const
Provides the color of the BaseTiledObject.
virtual void load(wxDataInputStream &stream)
Loads a BaseTiledObject from an input stream.
virtual void save(wxDataOutputStream &stream) const
Writes a BaseTiledObject to an output stream.
BaseTiledObject(const TileObject * const pTile)
The BaseTiledObject constructor.
virtual ~BaseTiledObject()=0
The BaseTiledObject destructor.
const TileObject * const mpTile
The TileObject the chip lays upon, from which it draws its location, roll value, and id.
Represents one hexagonally-shaped tile on the board.
wxInt32 mDisplayFlags
The object display flags.
An interface for all game objects.
ModelCore provides all of the data classes and associated helper classes and functions required to represent a complete game.