Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
prefabfactory.h File Reference

Header file for PrefabFactory class, responsible for creating game object prefabs. More...

#include "system/system_utils.h"
#include "ComponentDefinition.h"
#include "PrefabScanner.h"
#include "ParameterResolver.h"
#include <map>
#include <memory>
#include <functional>
#include <vector>
+ Include dependency graph for prefabfactory.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PrefabFactory
 Factory class for creating entities from prefab blueprints. More...
 

Macros

#define REGISTER_PREFAB(Name, BuilderLambda)
 

Typedefs

using PrefabBuilder = std::function< void(EntityID)>
 

Functions

void RegisterComponentFactory_Internal (const char *componentName, std::function< bool(EntityID, const ComponentDefinition &)> factory)
 

Detailed Description

Header file for PrefabFactory class, responsible for creating game object prefabs.

Author
Nicolas Chereau
Date
2025

Purpose:

Definition in file prefabfactory.h.

Macro Definition Documentation

◆ REGISTER_PREFAB

#define REGISTER_PREFAB (   Name,
  BuilderLambda 
)
Value:
namespace { \
struct AutoRegister##Name { \
AutoRegister##Name() { \
PrefabFactory::Get().RegisterPrefab(#Name, BuilderLambda); \
} \
}; \
AutoRegister##Name global_##Name; \
}
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
Classe utilitaire qui enregistre la classe T dans la fabrique lors de son initialisation statique.

Definition at line 266 of file prefabfactory.h.

Typedef Documentation

◆ PrefabBuilder

Definition at line 21 of file prefabfactory.h.

Function Documentation

◆ RegisterComponentFactory_Internal()

void RegisterComponentFactory_Internal ( const char componentName,
std::function< bool(EntityID, const ComponentDefinition &)>  factory 
)

Definition at line 63 of file PrefabFactory.cpp.

References PrefabFactory::Get(), GetComponentTypeID_Static(), and PrefabFactory::RegisterComponentFactory().

+ Here is the call graph for this function: