StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::CreateComponents Class Reference

Factory system for creating components from serialized data. More...

#include <main/Component.hpp>

Static Public Member Functions

static ComponentCreate (const std::string &type, Utilities::Stream &stream)
 Create component from serialized data.
 
template<class T>
static bool RegisterComponentType (std::string type)
 Register a component type for creation.
 

Detailed Description

Factory system for creating components from serialized data.

Manages component type registration and instantiation from serialization data. Allows components to be created dynamically at runtime.

Member Function Documentation

◆ Create()

Component * StevEngine::CreateComponents::Create ( const std::string & type,
Utilities::Stream & stream )
static

Create component from serialized data.

Parameters
typetype string of the component to create
streamtext serializable stream containing component data
Returns
Pointer to created component

◆ RegisterComponentType()

template<class T>
static bool StevEngine::CreateComponents::RegisterComponentType ( std::string type)
inlinestatic

Register a component type for creation.

Template Parameters
TComponent class type
Parameters
typeString identifier for component type
Returns
true if registration succeeded, false if type already registered

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