ChipObject

Stores game information for a roll chip laying on top of a tile.  Since the only important information for a chip is its roll value and any rotation applied to it, all other game data is retrieved by querying the TileObject that the ChipObject is built on.

Derived From

BaseTiledObject

Project

ModelCore

Include

ChipObject.h

Summary
Stores game information for a roll chip laying on top of a tile.
The ChipObject constructor.
Reads the roll value from the TileObject.
Randomizes the rotation of both this chip.
Provides the rotation of the ChipObject.
Sets the rotation of the ChipObject.
Loads a ChipObject from an input stream.
Writes a ChipObject to an output stream.
Resets the class name of the ChipObject.
The rotation applied to the chip.

Public

Summary
The ChipObject constructor.
Reads the roll value from the TileObject.
Randomizes the rotation of both this chip.
Provides the rotation of the ChipObject.
Sets the rotation of the ChipObject.
Loads a ChipObject from an input stream.
Writes a ChipObject to an output stream.
Resets the class name of the ChipObject.

Constructors

ChipObject

ChipObject(const TileObject * const pTile = NULL)

The ChipObject constructor.

Parameters

pTileA pointer to the TileObject the ChipObject is built on and will refer to for non-chip game data.

Functions

roll

wxInt32 roll() const

Reads the roll value from the TileObject.  The roll value is needed for rendering the chip in OpenGL with the right texture.

Returns

The roll value of the ChipObject.

randomizeRotation

void randomizeRotation()

Randomizes the rotation of both this chip.  The chip is rotated from 0 to 360 degrees.

Virtual Functions

rotation

virtual float rotation() const

Provides the rotation of the ChipObject.

Returns

The rotation of the ChipObject.

rotation

virtual void rotation(const float val)

Sets the rotation of the ChipObject.

Parameters

valThe new rotation.

load

virtual void load(wxDataInputStream &stream)

Loads a ChipObject from an input stream.

Parameters

streamThe input stream.

save

virtual void save(wxDataOutputStream &stream) const

Writes a ChipObject to an output stream.

Parameters

streamThe output stream.

Virtual Functions

name

virtual wxString name()

Resets the class name of the ChipObject.

Returns

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

Private

Summary
The rotation applied to the chip.

Variables

mRotation

float mRotation

The rotation applied to the chip.

ChipObject(const TileObject * const pTile = NULL)
The ChipObject constructor.
wxInt32 roll() const
Reads the roll value from the TileObject.
Represents one hexagonally-shaped tile on the board.
void randomizeRotation()
Randomizes the rotation of both this chip.
virtual float rotation() const
Provides the rotation of the ChipObject.
virtual void load(wxDataInputStream &stream)
Loads a ChipObject from an input stream.
virtual void save(wxDataOutputStream &stream) const
Writes a ChipObject to an output stream.
virtual wxString name()
Resets the class name of the ChipObject.
float mRotation
The rotation applied to the chip.
Common base class for objects that lay on top of a tile.
ModelCore provides all of the data classes and associated helper classes and functions required to represent a complete game.