SideObject

A base class for objects that sit on the sides of hexes.  There are several GameObjects such as roads and ships that sit on the sides of two hexes.  SideObject provides a base class for them all since they share much in common.

Derived From

GameObject

Project

ModelCore

Include

SideObject.h

Summary
A base class for objects that sit on the sides of hexes.
The SideObject destructor.
Returns the first tile and side the object is on.
Returns the second tile and side the object is on.
Returns the color of the object.
Sets the color of the object.
Loads a SideObject from an input stream.
Writes a SideObject to an output stream.
The CornerObject constructor.
The first tile/side this object is on.
The second tile/side this object is on.
The color of this object.

Public

Summary
The SideObject destructor.
Returns the first tile and side the object is on.
Returns the second tile and side the object is on.
Returns the color of the object.
Sets the color of the object.
Loads a SideObject from an input stream.
Writes a SideObject to an output stream.

Destructor

~SideObject

virtual ~SideObject()=0

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

Functions

tile1

TileCorner tile1() const

Returns the first tile and side the object is on.

Returns

A std::pair of the first tile and side the object is on.

tile2

TileCorner tile2() const

Returns the second tile and side the object is on.

Returns

A std::pair of the second tile and side the object is on.

Virtual Functions

color

virtual ColorType color() const

Returns the color of the object.

Returns

The color of the object.

color

virtual void color(const ColorType color)

Sets the color of the object.

Parameters

colorThe new color of the object.

load

virtual void load(wxDataInputStream &stream)

Loads a SideObject from an input stream.

Parameters

streamThe input stream.

save

virtual void save(wxDataOutputStream &stream) const

Writes a SideObject to an output stream.

Parameters

streamThe output stream.

Protected

Summary
The CornerObject constructor.

Constructor

SideObject

SideObject(const ColorType color,
const GamePtr &game,
const wxInt32 tile,
const wxInt32 side,
const Vector &initial)

The CornerObject constructor.  Finds the neighboring tile from the given tile and sets the coordinates for the object based on the tile and side.

Parameters

colorThe color of this object.  Should be some player’s color.
gameThe current Game object.
tileThe tile the object is on.
sideThe side on the tile the object is on.  From 0 to 5 inclusive.
initialAny initial location if this is a generic object.

Private

Summary
The first tile/side this object is on.
The second tile/side this object is on.
The color of this object.

Variables

mTile1

TileCorner mTile1

The first tile/side this object is on.

mTile2

TileCorner mTile2

The second tile/side this object is on.

mColor

ColorType mColor

The color of this object.

virtual ~SideObject()=0
The SideObject destructor.
TileCorner tile1() const
Returns the first tile and side the object is on.
TileCorner tile2() const
Returns the second tile and side the object is on.
virtual ColorType color() const
Returns the color of the object.
virtual void load(wxDataInputStream &stream)
Loads a SideObject from an input stream.
virtual void save(wxDataOutputStream &stream) const
Writes a SideObject to an output stream.
SideObject(const ColorType color,
const GamePtr &game,
const wxInt32 tile,
const wxInt32 side,
const Vector &initial)
The CornerObject constructor.
TileCorner mTile1
The first tile/side this object is on.
TileCorner mTile2
The second tile/side this object is on.
ColorType mColor
The color of this object.
A default implementation of the IGameObject interface.
ModelCore provides all of the data classes and associated helper classes and functions required to represent a complete game.
Still volatile.