fysxasteroids/engine/EntityFactoryBase.h

36 lines
990 B
C++

#ifndef _ENTITYFACTORYBASE_H
#define _ENTITYFACTORYASE_H
#include "Module.h"
namespace Engine {
struct EntityBase;
struct EntityPhysicState;
struct EntityControllerState;
/** \brief Takes care of the creation of user-defined Entities
*
* To be able to define custom types of Entities we use a Object Factory for
* which the actual CreateEntityXYZState () function can be overloaded with
* the creation of custom types.
*
* The method EntityFactory::CreateEntity() will be called by the
* Model::CreateEntity() function which also takes care of registering the
* Entity to required submodules.
*/
class EntityFactoryBase : public Module {
public: EntityFactoryBase () {};
virtual EntityPhysicState* CreateEntityPhysicState (int type);
virtual EntityControllerState* CreateEntityControllerState (int type);
virtual EntityBase* CreateEntity (int type);
protected:
virtual int OnInit (int argc, char* argv[]);
};
}
#endif // _ENTITYFACTORYBASE_H