SideSelectionObject

A SelectionObject for selecting sides of hexes.  Some objects reside on the sides of two hexes, like roads and ships.  During the game, there are opportunities for players to place a new one of these on the board.  The class SideSelectionObject provides a way for the View to represent the available sides for selection in the game.  It stores a boost::tuple (see http://www.boost.org /libs /tuple /doc /tuple_users_guide.html) of a side ID, Vector coordinates of the side, and a float rotation that should be applied to the selection to make it line up along the side of a hex.  The class DrawSideSelectionObject (located in CoreRules) is responsible for actually drawing the locations on the screen, but the SideSelectionObject provides all of the data for drawing, just like any other IGameObject/IDrawObject pairing.

An IRule may create a SideSelectionObject and then add new side tuples to it via the add function.  The side tuples can be read out of the SideSelectionObject via the iterator-providing selection_begin and selection_end functions.

Derived From

SelectionObject

Project

RulesCore

Include

SideSelectionObject.h

Summary
A SelectionObject for selecting sides of hexes.
The SideSelectionObject constructor.
Adds another side ID/Vector/rotation tuple to the std::list.
Returns an iterator to the start of the side ID/Vector/rotation std::list.
Returns an iterator to the end of the side ID/Vector/rotation std::list.
Clones the SideSelectionObject.
Resets the class name of the SideSelectionObject.
The std::list of corner ID/Vector/rotation tuples that are selectable sides.

Public

Summary
The SideSelectionObject constructor.
Adds another side ID/Vector/rotation tuple to the std::list.
Returns an iterator to the start of the side ID/Vector/rotation std::list.
Returns an iterator to the end of the side ID/Vector/rotation std::list.
Clones the SideSelectionObject.
Resets the class name of the SideSelectionObject.

Constructors

SideSelectionObject

SideSelectionObject(const wxString &rule,
const ColorType color) : SelectionObject(rule, color)

The SideSelectionObject constructor.  Stores the given rule name and selection color.  See SelectionObject for details.

Functions

add

void add(const SideSelectionTuple &tuple)

Adds another side ID/Vector/rotation tuple to the std::list.

selection_begin

SideSelectionList::const_iterator selection_begin()

Returns an iterator to the start of the side ID/Vector/rotation std::list.

Returns

A const_iterator to the start of the side ID/Vector/rotation std::list.

selection_end

SideSelectionList::const_iterator selection_end()

Returns an iterator to the end of the side ID/Vector/rotation std::list.

Returns

A const_iterator to the end of the side ID/Vector/rotation std::list.

Virtual Functions

Clone

virtual IGameObject *Clone()

Clones the SideSelectionObject.  Unused.

Returns

A NULL pointer.

name

virtual wxString name()

Resets the class name of the SideSelectionObject.

Returns

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

Private

Summary
The std::list of corner ID/Vector/rotation tuples that are selectable sides.

Variables

mSelectionList

SideSelectionList mSelectionList

The std::list of corner ID/Vector/rotation tuples that are selectable sides.

The base class for all selection-related IGameObjects.
SideSelectionObject(const wxString &rule,
const ColorType color) : SelectionObject(rule, color)
The SideSelectionObject constructor.
void add(const SideSelectionTuple &tuple)
Adds another side ID/Vector/rotation tuple to the std::list.
A lightweight 1x3 vector class.
SideSelectionList::const_iterator selection_begin()
Returns an iterator to the start of the side ID/Vector/rotation std::list.
SideSelectionList::const_iterator selection_end()
Returns an iterator to the end of the side ID/Vector/rotation std::list.
virtual IGameObject *Clone()
Clones the SideSelectionObject.
virtual wxString name()
Resets the class name of the SideSelectionObject.
SideSelectionList mSelectionList
The std::list of corner ID/Vector/rotation tuples that are selectable sides.
Needs documentation.
An interface for all game objects.
The interface for objects that are drawn on screen.
The interface for a single game rule.
RulesCore is the HOSS of Cities3D.