DrawObjectEngine

The standard implementation of the IDrawObjectEngine interface.  DrawObjectEngine stores all of the IDrawObjects provided by the loaded RuleSets internally in a std::list container.  The functions required by the IDrawObjectEngine interface are implemented by taking the std::list and performing the necessary operations.  See the function documentation below for more details.

Derived From

IDrawObjectEngine

Project

RulesCore

Include

DrawObjectEngine.h

Summary
The standard implementation of the IDrawObjectEngine interface.
Stops the DrawObjectEngine.
Creates a new IDrawObject capable of drawing the given IGameObject.
Lets all IDrawObjects obtain needed resources.
Lets all IDrawObjects release acquired resources.
The std::list of IDrawObjects available to the game.

Public

Summary
Stops the DrawObjectEngine.
Creates a new IDrawObject capable of drawing the given IGameObject.
Lets all IDrawObjects obtain needed resources.
Lets all IDrawObjects release acquired resources.

Functions

Stop

void Stop()

Stops the DrawObjectEngine.  Clears the std::list of IDrawObjects.

Virtual Functions

CreateDrawObject

virtual DrawObjectPtr CreateDrawObject(const GameObjectPtr &object) const

Creates a new IDrawObject capable of drawing the given IGameObject.  Searches the std::list of IDrawObjects, calling CanBuild on each with the given IGameObject until an IDrawObject is found that can build it.  If one is found, the new IDrawObject is created using the prototype’s Clone function and then returned.  If a handler can’t be found, an empty object is returned.

Parameters

objectThe IGameObject for which an IDrawObject is needed.

Returns

A newly cloned IDrawObject that can draw the IGameObject.  May be NULL if no capable IDrawObject was found.

ObtainAll

virtual void ObtainAll()

Lets all IDrawObjects obtain needed resources.  Calls the Obtain function on each IDrawObject in the std::list.

ReleaseAll

virtual void ReleaseAll()

Lets all IDrawObjects release acquired resources.  Calls the Release function on each IDrawObject in the std::list.

Private

Summary
The std::list of IDrawObjects available to the game.

Variables

mObjectList

DrawObjectPtrList mObjectList

The std::list of IDrawObjects available to the game.

The interface of the IDrawObject engine.
void Stop()
Stops the DrawObjectEngine.
virtual DrawObjectPtr CreateDrawObject(const GameObjectPtr &object) const
Creates a new IDrawObject capable of drawing the given IGameObject.
The interface for objects that are drawn on screen.
An interface for all game objects.
virtual void ObtainAll()
Lets all IDrawObjects obtain needed resources.
virtual void ReleaseAll()
Lets all IDrawObjects release acquired resources.
DrawObjectPtrList mObjectList
The std::list of IDrawObjects available to the game.
A repository of all things rules-related.
RulesCore is the HOSS of Cities3D.
virtual bool CanBuild(const GameObjectPtr &object) const=0
Queries the IDrawObject to see if they can draw a certain IGameObject.
virtual IGameObject *Clone()
Clones the TileObject.