The interface for objects that are drawn on screen. The IDrawObject class is an implementation of the Prototype design pattern. When a RuleSet is loaded, all of its associated IDrawObjects are stored in the IDrawObjectEngine. When a new IGameObject is added to the game, the IDrawObjectEngine is queried for any IDrawObject capable of drawing it. If one is found, that IDrawObject is cloned and given the IGameObject to draw.
IDrawObject.h
The interface for objects that are drawn on screen. | |
The DrawObject destructor. | |
Queries the IDrawObject to see if they can draw a certain IGameObject. | |
Returns whether this IDrawObject can be deleted. | |
Returns whether this IDrawObject can be selected. | |
Creates a clone of the IDrawObject. | |
Returns the draw priority of this object. | |
Draws the object on the screen. | |
Allows derived classes to do their own resource management. | |
Allows derived classes to do clean up after themselves. |
The DrawObject destructor. | |
Queries the IDrawObject to see if they can draw a certain IGameObject. | |
Returns whether this IDrawObject can be deleted. | |
Returns whether this IDrawObject can be selected. | |
Creates a clone of the IDrawObject. | |
Returns the draw priority of this object. | |
Draws the object on the screen. | |
Allows derived classes to do their own resource management. | |
Allows derived classes to do clean up after themselves. |
|
Queries the IDrawObject to see if they can draw a certain IGameObject.
| object | The GameObject this IDrawObject is being asked if it can build. |
A bool indicating whether the IDrawObject can build the given IGameObject. The value is true if it can, false if not.
|
Returns whether this IDrawObject can be selected.
| origin | The origin point of the selection ray. |
| ray | The selection ray direction. |
| distance | Filled with the outgoing distance the object is from the ray origin, if the object is selectable. |
| id | Filled with the ougoing id of the selectable IGameObject, if the object is selectable. |
A bool that is true if the object can be selected and false if not.
|
Creates a clone of the IDrawObject. IDrawObjects are an implementation of the Prototype pattern and must provide a way to clone themselves from a stored prototype.
| pObject | The GameObject the cloned DrawObject will reference. |
| virtual ~IDrawObject()=0 |
|
| virtual bool CanDelete() const=0 |
|
|
| virtual wxInt32 GetPriority() const=0 |
|
| virtual void Obtain()=0 |
| virtual void Release()=0 |