CornerSelectionObject

A SelectionObject for selecting corners of hexes.  Some objects reside on the corners of three hexes, like settlements, cities, knights, etc.  During the game, there are opportunities for players to place a new one of these objects on the board.  The class CornerSelectionObject provides a way for the View to represent the available corners for selection in the game.  It stores a list of std::pair<> objects of a corner ID and the Vector coordinates of the corner.  The class DrawCornerSelectionObject (located in CoreRules) is responsible for actually drawing the locations on the screen, but CornerSelectionObject provides all of the data for drawing, just like any other IGameObject/IDrawObject pairing.

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

Derived From

SelectionObject

Project

RulesCore

Include

CornerSelectionObject.h

Summary
A SelectionObject for selecting corners of hexes.
The CornerSelectionObject constructor.
Adds another corner ID/Vector pair to the std::list.
Returns an iterator to the start of the corner ID/Vector std::list.
Returns an iterator to the end of the corner ID/Vector std::list.
Clones the CornerSelectionObject.
Resets the class name of the CornerSelectionObject.
The std::list of corner ID/Vector pairs that are selectable corners.

Public

Summary
The CornerSelectionObject constructor.
Adds another corner ID/Vector pair to the std::list.
Returns an iterator to the start of the corner ID/Vector std::list.
Returns an iterator to the end of the corner ID/Vector std::list.
Clones the CornerSelectionObject.
Resets the class name of the CornerSelectionObject.

Constructors

CornerSelectionObject

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

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

Functions

add

void add(const CornerSelectionPair &pair)

Adds another corner ID/Vector pair to the std::list.

selection_begin

CornerSelectionList::const_iterator selection_begin()

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

Returns

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

selection_end

CornerSelectionList::const_iterator selection_end()

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

Returns

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

Virtual Functions

Clone

virtual IGameObject *Clone()

Clones the CornerSelectionObject.  Unused.

Returns

A NULL pointer.

name

virtual wxString name()

Resets the class name of the CornerSelectionObject.

Returns

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

Private

Summary
The std::list of corner ID/Vector pairs that are selectable corners.

Variables

mSelectionList

CornerSelectionList mSelectionList

The std::list of corner ID/Vector pairs that are selectable corners.

The base class for all selection-related IGameObjects.
CornerSelectionObject(const wxString &rule,
const ColorType color) : SelectionObject(rule, color)
The CornerSelectionObject constructor.
void add(const CornerSelectionPair &pair)
Adds another corner ID/Vector pair to the std::list.
A lightweight 1x3 vector class.
CornerSelectionList::const_iterator selection_begin()
Returns an iterator to the start of the corner ID/Vector std::list.
CornerSelectionList::const_iterator selection_end()
Returns an iterator to the end of the corner ID/Vector std::list.
virtual IGameObject *Clone()
Clones the CornerSelectionObject.
virtual wxString name()
Resets the class name of the CornerSelectionObject.
CornerSelectionList mSelectionList
The std::list of corner ID/Vector pairs that are selectable corners.
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.