AggregatorObject

Aggregates IGameObjects so they can be sent to the renderer in one batch.  At various points in the game, many new game objects are created at once, such as the board being constructed, or seaports being turned on and off.  Using an AggregatorObject to pass them all to the view at once allows for much greater function call efficiency then calling the view dozens of times with single objects.

Project

ModelCore

Include

AggregatorObject.h

Summary
Aggregates IGameObjects so they can be sent to the renderer in one batch.
A std::list container of IGameObject shared_ptrs.
Provides an iterator to the start of the IGameObject list.
Provides an iterator to the end of the IGameObject list.
Adds a new IGameObject shared_ptr to the end of the list.
Returns the raw std::list of IGameObjects.
The std::list of IGameObject shared_ptrs.

Public

Summary
A std::list container of IGameObject shared_ptrs.
Provides an iterator to the start of the IGameObject list.
Provides an iterator to the end of the IGameObject list.
Adds a new IGameObject shared_ptr to the end of the list.
Returns the raw std::list of IGameObjects.

Typedefs

GameObjectList

A std::list container of IGameObject shared_ptrs.

Functions

objects_begin

GameObjectList::const_iterator objects_begin()

Provides an iterator to the start of the IGameObject list.

Returns

A GameObjectList const_iterator to the start of the list.

objects_end

GameObjectList::const_iterator objects_end()

Provides an iterator to the end of the IGameObject list.

Returns

A GameObjectList const_iterator to the end of the list.

add

void add(const GameObjectPtr &object)

Adds a new IGameObject shared_ptr to the end of the list.

Parameters

objectThe IGameObject shared_ptr to add.

list

GameObjectList &list()

Returns the raw std::list of IGameObjects.

Returns

A reference to the std::list of IGameObjects.

Private

Summary
The std::list of IGameObject shared_ptrs.

Variables

mObjectList

GameObjectList mObjectList

The std::list of IGameObject shared_ptrs.

An interface for all game objects.
GameObjectList::const_iterator objects_begin()
Provides an iterator to the start of the IGameObject list.
GameObjectList::const_iterator objects_end()
Provides an iterator to the end of the IGameObject list.
void add(const GameObjectPtr &object)
Adds a new IGameObject shared_ptr to the end of the list.
GameObjectList &list()
Returns the raw std::list of IGameObjects.
GameObjectList mObjectList
The std::list of IGameObject shared_ptrs.
ModelCore provides all of the data classes and associated helper classes and functions required to represent a complete game.