RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
CGameObjectFactory Class Reference

#include <cgameobjectfactory.h>

Static Public Member Functions

template<class T >
static bool addType ()
 
static const QStringList & types ()
 
static CGameObjectcreateInstance (const char *class_name)
 
static const QString & getTypeNameHavingId (int type_id)
 
static int getObjectTypeId (const char *class_name)
 

Detailed Description

The user is able to select a custom type for any game object while creating the game scene in the editor. So, any Type that inherits from CGameObject can be attached to a CGameObject at runtime. CGameObjectFactory is used to register these special types and also to instantiate game objects.

Definition at line 44 of file cgameobjectfactory.h.

Member Function Documentation

template<class T >
static bool CGameObjectFactory::addType ( )
inlinestatic

Registers the specified Type. Note: It must inherit from CGameObject!

Definition at line 50 of file cgameobjectfactory.h.

CGameObject * CGameObjectFactory::createInstance ( const char *  class_name)
static

Instantiates a game object with the specified type. Note: The type must have been previously registered by the addType<T>() method

Definition at line 41 of file cgameobjectfactory.cpp.

int CGameObjectFactory::getObjectTypeId ( const char *  class_name)
static

Returns the type id associated to the class_name

Definition at line 61 of file cgameobjectfactory.cpp.

const QString & CGameObjectFactory::getTypeNameHavingId ( int  type_id)
static

Returns the type name associated to the specified type_id

Definition at line 67 of file cgameobjectfactory.cpp.

const QStringList & CGameObjectFactory::types ( )
static

Returns the current supported type list

Definition at line 55 of file cgameobjectfactory.cpp.


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