Cafu Engine
cf::GameSys::GameI Class Referenceabstract

The game interface, specified as an ABC so that is can be used without linked (module-local) implementation. More...

#include "Game.hpp"

Inheritance diagram for cf::GameSys::GameI:

Public Member Functions

virtual void Initialize (bool AsClient, bool AsServer, ModelManagerT &ModelMan)=0
 Called to initialize the game. More...
 
virtual void Release ()=0
 Called to shutdown the game. More...
 
virtual const
cf::TypeSys::TypeInfoManT
GetEntityTIM () const =0
 Returns the type information manager with the entity hierarchy. More...
 
virtual IntrusivePtrT
< GameEntityI
CreateGameEntity (const cf::TypeSys::TypeInfoT *TI, IntrusivePtrT< cf::GameSys::EntityT > Entity, const std::map< std::string, std::string > &Properties, const cf::SceneGraph::GenericNodeT *RootNode, unsigned long ID, cf::GameSys::GameWorldI *GameWorld)=0
 Creates a new entity of the given type. More...
 
virtual ~GameI ()
 The virtual destructor, so that derived classes can safely be deleted via a GameI (base class) pointer. More...
 

Detailed Description

The game interface, specified as an ABC so that is can be used without linked (module-local) implementation.

This interface is implemented by the game DLL, and thus defines the essence of a game/MOD. It is used (only) by the engine to run the game.

Constructor & Destructor Documentation

virtual cf::GameSys::GameI::~GameI ( )
inlinevirtual

The virtual destructor, so that derived classes can safely be deleted via a GameI (base class) pointer.

Member Function Documentation

virtual IntrusivePtrT<GameEntityI> cf::GameSys::GameI::CreateGameEntity ( const cf::TypeSys::TypeInfoT TI,
IntrusivePtrT< cf::GameSys::EntityT Entity,
const std::map< std::string, std::string > &  Properties,
const cf::SceneGraph::GenericNodeT RootNode,
unsigned long  ID,
cf::GameSys::GameWorldI GameWorld 
)
pure virtual

Creates a new entity of the given type.

Parameters
TIThe type of entity to create.
EntityThe associated entity in the cf::GameSys::WorldT.
PropertiesThe properties dictionary in the map file of this entity (empty if the entity is created "dynamically"). Contains especially the "classname" key that was used by the caller to determine TI.
RootNodeThe root node of the scene graph of this entity as defined in the map file. NULL if the entity is created "dynamically".
IDThe global unique ID of this entity (in the current map).
GameWorldPointer to the game world implementation.
Returns
a pointer to the newly created game entity.

Implemented in DeathMatch::GameImplT.

virtual const cf::TypeSys::TypeInfoManT& cf::GameSys::GameI::GetEntityTIM ( ) const
pure virtual

Returns the type information manager with the entity hierarchy.

Implemented in DeathMatch::GameImplT.

virtual void cf::GameSys::GameI::Initialize ( bool  AsClient,
bool  AsServer,
ModelManagerT ModelMan 
)
pure virtual

Called to initialize the game.

This function is called exactly once as the very first function after the game has been loaded, not each time a new world is about to be loaded.

Parameters
AsClientTells whether we're running as client.
AsServerTells whether we're running as server.
ModelManThe manager for all models that are used in this game.

Implemented in DeathMatch::GameImplT.

virtual void cf::GameSys::GameI::Release ( )
pure virtual

Called to shutdown the game.

This function is called exactly once as the very last function before the game is released, not each time a world is being freed.

Implemented in DeathMatch::GameImplT.


The documentation for this class was generated from the following file: