Cafu Engine
cf::GameSys::GameWorldI Class Referenceabstract

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

#include "GameWorld.hpp"

Inheritance diagram for cf::GameSys::GameWorldI:

Public Member Functions

virtual ~GameWorldI ()
 The virtual destructor, so that derived classes can safely be deleted via a GameWorldI (base class) pointer. More...
 
virtual cf::GameSys::GameIGetGame ()=0
 Returns the game that this is a world of. More...
 
virtual cf::ClipSys::ClipWorldTGetClipWorld ()=0
 Returns the clip world for the game world. More...
 
virtual PhysicsWorldTGetPhysicsWorld ()=0
 Returns the physics world for the game world. More...
 
virtual Vector3fT GetAmbientLightColorFromBB (const BoundingBox3T< double > &Dimensions, const VectorT &Origin) const =0
 Returns a "good" ambient light color for an arbitrary object (i.e. More...
 
virtual const ArrayT< unsigned
long > & 
GetAllEntityIDs () const =0
 Returns (a reference to) an array that contains the IDs of all entities that currently exist in the world. More...
 
virtual IntrusivePtrT
< GameEntityI
GetGameEntityByID (unsigned long EntityID) const =0
 Returns a pointer to the entity with ID 'EntityID'. More...
 
virtual void RemoveEntity (unsigned long EntityID)=0
 Removes the entity identified by 'EntityID' from the (server) world. More...
 
virtual const CafuModelTGetModel (const std::string &FileName) const =0
 Returns a model for the given filename. More...
 
virtual cf::GuiSys::GuiResourcesTGetGuiResources () const =0
 Returns the GUI resources that are commonly used in this game world. More...
 

Detailed Description

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

The engine provides each entity that it creates with a pointer to an implementation of this interface (as entities can be created on the client and the server side, there can be more than one implementation). See the GameI::CreateGameEntityFrom*() methods for the "source" of these pointers: When one of these methods is called, a pointer to a GameWorldI is one of the parameters.

Constructor & Destructor Documentation

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

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

However, with GameWorldIs that's never supposed to happen, so this destructor only exists to silence the g++ compiler warning.

Member Function Documentation

virtual const ArrayT<unsigned long>& cf::GameSys::GameWorldI::GetAllEntityIDs ( ) const
pure virtual

Returns (a reference to) an array that contains the IDs of all entities that currently exist in the world.

Implemented in Ca3DEWorldT.

virtual Vector3fT cf::GameSys::GameWorldI::GetAmbientLightColorFromBB ( const BoundingBox3T< double > &  Dimensions,
const VectorT Origin 
) const
pure virtual

Returns a "good" ambient light color for an arbitrary object (i.e.

a model) of size Dimensions at Origin. The return value is derived from the worlds lightmap information "close" to the Dimensions at Origin.

Implemented in Ca3DEWorldT.

virtual cf::ClipSys::ClipWorldT& cf::GameSys::GameWorldI::GetClipWorld ( )
pure virtual

Returns the clip world for the game world.

Implemented in Ca3DEWorldT.

virtual cf::GameSys::GameI* cf::GameSys::GameWorldI::GetGame ( )
pure virtual

Returns the game that this is a world of.

Implemented in Ca3DEWorldT.

virtual IntrusivePtrT<GameEntityI> cf::GameSys::GameWorldI::GetGameEntityByID ( unsigned long  EntityID) const
pure virtual

Returns a pointer to the entity with ID 'EntityID'.

NULL is returned if that entity does not exist.

Implemented in Ca3DEWorldT.

virtual cf::GuiSys::GuiResourcesT& cf::GameSys::GameWorldI::GetGuiResources ( ) const
pure virtual

Returns the GUI resources that are commonly used in this game world.

Implemented in Ca3DEWorldT.

virtual const CafuModelT* cf::GameSys::GameWorldI::GetModel ( const std::string &  FileName) const
pure virtual

Returns a model for the given filename.

The returned model instance is managed by the GameWorldI implementation in a ModelManagerT, thus the caller does not have to (and if fact, must not) delete the CafuModelT instance.

Implemented in Ca3DEWorldT.

virtual PhysicsWorldT& cf::GameSys::GameWorldI::GetPhysicsWorld ( )
pure virtual

Returns the physics world for the game world.

Implemented in Ca3DEWorldT.

virtual void cf::GameSys::GameWorldI::RemoveEntity ( unsigned long  EntityID)
pure virtual

Removes the entity identified by 'EntityID' from the (server) world.

Implemented in CaClientWorldT, and CaServerWorldT.


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