A factory for components.
More...
#include <component_factory.h>
A factory for components.
Duh.
Typedef for a component factory function.
Takes a storage container and returns a std::unique_ptr to the new component.
| ComponentFactory::ComponentFactory |
( |
| ) |
|
Constructor.
Usually only used by the Engine.
| ComponentTypeId ComponentFactory::getTypeId |
( |
const std::string & |
name | ) |
const |
Looks up a component type name and returns its id.
- Parameters
-
| name | The component type name |
- Returns
- The component type's unique id or NULL_COMPONENT_TYPE if the type name is not registered.
| std::string ComponentFactory::getTypeName |
( |
ComponentTypeId |
typeId | ) |
const |
Looks up a component type id and returns its name.
- Parameters
-
| typeId | The component type id |
- Returns
- The component type name or an empty string if the type id is unknown.
Loads a component from storage.
- Parameters
-
| typeName | The name of the component type |
| storage | The component's storage container. May be empty. |
- Returns
- A new component
| luabind::scope ComponentFactory::luaBindings |
( |
| ) |
|
|
static |
| ComponentTypeId ComponentFactory::registerComponentType |
( |
const std::string & |
name, |
|
|
ComponentLoader |
loader |
|
) |
| |
Registers a component type with this factory.
- Parameters
-
| name | The type name |
| loader | The function used for loading this component type |
- Returns
- The type's unique id
template<typename C >
| static ComponentTypeId thrive::ComponentFactory::registerGlobalComponentType |
( |
| ) |
|
|
inlinestatic |
Registers a component type for all factories.
- Template Parameters
-
- Returns
- The type's unique id
- Note
- You should probably use the REGISTER_COMPONENT macro instead of calling this directly.
| void ComponentFactory::unregisterComponentType |
( |
const std::string & |
name | ) |
|
Unregisters a component type.
- Parameters
-
The documentation for this class was generated from the following files:
- /home/hhyyrylainen/Projects/thrive_install/thrive/src/engine/component_factory.h
- /home/hhyyrylainen/Projects/thrive_install/thrive/src/engine/component_factory.cpp