A base class for objects that sit on the corners of hexes. There are many GameObjects such as settlements, cities, knights, etc., that sit on the intersection of three hexes. CornerObject provides a base class for them all since they share much in common.
CornerObject.h
A base class for objects that sit on the corners of hexes. | |
The CornerObject destructor. | |
Compares another CornerObject to this one to see if they are the same. | |
Returns the first tile and corner the object is on. | |
Returns the second tile and corner the object is on. | |
Returns the third tile and corner the object is on. | |
Returns whether the CornerObject is on the given tile and corner. | |
Returns the color of the object. | |
Sets the color of the object. | |
Loads a CornerObject from an input stream. | |
Writes a CornerObject to an output stream. | |
The CornerObject constructor. | |
The first tile/corner this object is on. | |
The second tile/corner this object is on. | |
The third tile/corner this object is on. | |
The color of this object. |
The CornerObject destructor. | |
Compares another CornerObject to this one to see if they are the same. | |
Returns the first tile and corner the object is on. | |
Returns the second tile and corner the object is on. | |
Returns the third tile and corner the object is on. | |
Returns whether the CornerObject is on the given tile and corner. | |
Returns the color of the object. | |
Sets the color of the object. | |
Loads a CornerObject from an input stream. | |
Writes a CornerObject to an output stream. |
|
Compares another CornerObject to this one to see if they are the same. All three tile/corner combinations and the color must be equal for the objects to be the same.
A bool giving the equality of the given object. True if the object is the same, false if not.
|
The CornerObject constructor. Finds the neighboring tiles from the given tile and sets the coordinates for the object based on the tile and corner.
| color | The color of this object. Should be some player’s color. |
| game | The current Game object. |
| tile | The tile the object is on. |
| corner | The corner on the tile the object is on. From 0 to 5 inclusive. |
| initial | Any initial location if this is a generic object. |
| virtual ~CornerObject()=0 |
|
| TileCorner tile1() const |
| TileCorner tile2() const |
| TileCorner tile3() const |
|
| virtual ColorType color() const |
|
|
|
| TileCorner mTile1 |
| TileCorner mTile2 |
| TileCorner mTile3 |
| ColorType mColor |