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.
SideObject.h
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. |
|
The CornerObject constructor. Finds the neighboring tile from the given tile and sets the coordinates for the object based on the tile and side.
| color | The color of this object. Should be some player’s color. |
| game | The current Game object. |
| tile | The tile the object is on. |
| side | The side on the tile the object is on. From 0 to 5 inclusive. |
| initial | Any initial location if this is a generic object. |
| virtual ~SideObject()=0 |
| TileCorner tile1() const |
| TileCorner tile2() const |
| virtual ColorType color() const |
|
|
|
| TileCorner mTile1 |
| TileCorner mTile2 |
| ColorType mColor |