![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Factory class for creating entities from prefab blueprints. More...
#include <prefabfactory.h>
Collaboration diagram for PrefabFactory:Public Member Functions | |
| void | RegisterComponentFactory (const std::string &componentName, std::function< bool(EntityID, const ComponentDefinition &)> factory) |
| Register a component factory (called by auto-registration system) | |
| bool | IsComponentRegistered (const std::string &componentName) const |
| Check if a component is registered. | |
| std::vector< std::string > | GetRegisteredComponents () const |
| Get list of all registered components (for debugging) | |
| void | PreloadAllPrefabs (const std::string &prefabDirectory="Blueprints/EntityPrefab") |
| Preload all prefabs from directory. | |
| EntityID | CreateEntityFromPrefabName (const std::string &prefabName) |
| Create entity from prefab name. | |
| int | GetPrefabCount () const |
| Create entity from prefab name with explicit layer override. | |
| bool | HasPrefab (const std::string &prefabName) const |
| Check if prefab exists. | |
| void | RegisterPrefab (const std::string &name, PrefabBuilder builder) |
| Register a legacy prefab builder function. | |
| EntityID | CreateEntity (const std::string &prefabName) |
| Create an entity using legacy prefab system. | |
| void | SetPrefabRegistry (const PrefabRegistry ®istry) |
| Set the prefab registry cache. | |
| const PrefabRegistry & | GetPrefabRegistry () const |
| Get the cached prefab registry. | |
| std::string | NormalizeType (const std::string &type) const |
| Normalize a type string to canonical form. | |
| bool | AreTypesEquivalent (const std::string &type1, const std::string &type2) const |
| Check if two types are equivalent. | |
| bool | IsTypeRegistered (const std::string &type) const |
| Check if a type is registered. | |
| bool | GetCanonicalInfo (const std::string &type, std::string &outCanonical, std::string &outPrefabFile) const |
| Get canonical type info for debugging. | |
| EntityID | CreateEntityFromBlueprint (const PrefabBlueprint &blueprint, bool autoAssignLayer=true) |
| Create entity from a parsed blueprint. | |
| EntityID | CreateEntityWithOverrides (const PrefabBlueprint &blueprint, const LevelInstanceParameters &instanceParams, bool autoAssignLayer=true) |
| Create entity from blueprint with level instance parameter overrides. | |
| bool | InstantiateComponent (EntityID entity, const ComponentDefinition &componentDef) |
| Instantiate a single component on an entity. | |
Static Public Member Functions | |
| static PrefabFactory & | Get () |
| Get singleton instance. | |
Private Attributes | |
| std::map< std::string, PrefabBuilder > | m_prefabs |
| PrefabRegistry | m_prefabRegistry |
| bool | m_prefabsPreloaded = false |
| std::unique_ptr< PrefabScanner > | m_scanner |
| std::map< std::string, std::function< bool(EntityID, const ComponentDefinition &)> > | m_componentFactories |
Factory class for creating entities from prefab blueprints.
PrefabFactory manages entity creation from JSON blueprint files. It supports both modern component-agnostic instantiation and legacy function-based prefabs.
Definition at line 32 of file prefabfactory.h.
|
privatedefault |
| bool PrefabFactory::AreTypesEquivalent | ( | const std::string & | type1, |
| const std::string & | type2 | ||
| ) | const |
Check if two types are equivalent.
| type1 | First type string |
| type2 | Second type string |
Definition at line 165 of file PrefabFactory.cpp.
References GetComponentTypeID_Static(), and m_scanner.
Here is the call graph for this function:Create an entity using legacy prefab system.
| prefabName | Name of the prefab |
Definition at line 129 of file PrefabFactory.cpp.
References World::CreateEntity(), CreateEntityFromPrefabName(), World::Get(), GetComponentTypeID_Static(), m_prefabs, and SYSTEM_LOG.
Referenced by VideoGame::InitializeAITestScene().
Here is the call graph for this function:
Here is the caller graph for this function:| EntityID PrefabFactory::CreateEntityFromBlueprint | ( | const PrefabBlueprint & | blueprint, |
| bool | autoAssignLayer = true |
||
| ) |
Create entity from a parsed blueprint.
| blueprint | Parsed prefab blueprint |
| autoAssignLayer | If true, automatically assign layer based on EntityType |
Definition at line 193 of file PrefabFactory.cpp.
References World::AddComponent(), World::CreateEntity(), BehaviorTreeManager::Get(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), World::GetDefaultLayerForType(), BehaviorTreeManager::GetTreeIdFromPath(), World::HasComponent(), InstantiateComponent(), INVALID_ENTITY_ID, AIBehavior_data::isActive, World::SetEntityLayer(), and SYSTEM_LOG.
Referenced by CreateEntityFromPrefabName().
Here is the call graph for this function:
Here is the caller graph for this function:Create entity from prefab name.
Instantiates a new entity by loading and applying all components defined in the prefab blueprint file.
| prefabName | Name of the prefab (without .json extension) |
Definition at line 110 of file PrefabFactory.cpp.
References CreateEntityFromBlueprint(), PrefabRegistry::Find(), GetComponentTypeID_Static(), INVALID_ENTITY_ID, m_prefabRegistry, m_prefabsPreloaded, and SYSTEM_LOG.
Referenced by VideoGame::AddPlayerEntity(), and CreateEntity().
Here is the call graph for this function:
Here is the caller graph for this function:| EntityID PrefabFactory::CreateEntityWithOverrides | ( | const PrefabBlueprint & | blueprint, |
| const LevelInstanceParameters & | instanceParams, | ||
| bool | autoAssignLayer = true |
||
| ) |
Create entity from blueprint with level instance parameter overrides.
This is the unified method for both static and dynamic object creation.
| blueprint | Parsed prefab blueprint |
| instanceParams | Level instance parameters to override blueprint defaults |
| autoAssignLayer | If true, automatically assign layer based on EntityType |
Definition at line 287 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentDefinition::componentType, World::CreateEntity(), BehaviorTreeManager::Get(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), World::GetDefaultLayerForType(), BehaviorTreeManager::GetTreeIdFromPath(), World::HasComponent(), InstantiateComponent(), INVALID_ENTITY_ID, AIBehavior_data::isActive, Position_data::position, ParameterResolver::Resolve(), World::SetEntityLayer(), and SYSTEM_LOG.
Here is the call graph for this function:
|
inlinestatic |
Get singleton instance.
Definition at line 39 of file prefabfactory.h.
References GetComponentTypeID_Static().
Referenced by VideoGame::AddPlayerEntity(), Olympe::Tiled::TiledToOlympe::Convert(), World::Initialize_ECS_Systems(), VideoGame::InitializeAITestScene(), World::LoadLevelFromTiled(), RegisterComponentFactory_Internal(), BehaviorTreeDependencyScanner::ScanPrefabs(), and World::ValidateLevelPrefabs().
Here is the call graph for this function:
Here is the caller graph for this function:| bool PrefabFactory::GetCanonicalInfo | ( | const std::string & | type, |
| std::string & | outCanonical, | ||
| std::string & | outPrefabFile | ||
| ) | const |
Get canonical type info for debugging.
| type | Type to query |
| outCanonical | Output parameter for canonical type name |
| outPrefabFile | Output parameter for prefab file path |
Definition at line 183 of file PrefabFactory.cpp.
References GetComponentTypeID_Static(), and m_scanner.
Here is the call graph for this function:
|
inline |
Create entity from prefab name with explicit layer override.
Get prefab count
Definition at line 94 of file prefabfactory.h.
References PrefabRegistry::GetCount(), and m_prefabRegistry.
Here is the call graph for this function:
|
inline |
Get the cached prefab registry.
Definition at line 142 of file prefabfactory.h.
References m_prefabRegistry.
Referenced by BehaviorTreeDependencyScanner::ScanPrefabs().
Here is the caller graph for this function:| std::vector< std::string > PrefabFactory::GetRegisteredComponents | ( | ) | const |
Get list of all registered components (for debugging)
Definition at line 51 of file PrefabFactory.cpp.
References GetComponentTypeID_Static(), and m_componentFactories.
Here is the call graph for this function:Check if prefab exists.
| prefabName | Name of the prefab to check |
Definition at line 101 of file prefabfactory.h.
References PrefabRegistry::Find(), and m_prefabRegistry.
Here is the call graph for this function:
|
private |
Definition at line 860 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsString(), AIBehavior_data::behaviorType, World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 872 of file PrefabFactory.cpp.
References ComponentParameter::AsBool(), ComponentParameter::AsEntityRef(), ComponentParameter::AsFloat(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and AIBlackboard_data::targetEntity.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 909 of file PrefabFactory.cpp.
References ComponentParameter::AsFloat(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and AISenses_data::visionRadius.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1332 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsFloat(), ComponentParameter::AsString(), Combat, Dead, Flee, World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), Idle, Investigate, Patrol, and SYSTEM_LOG.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1057 of file PrefabFactory.cpp.
References World::AddComponent(), Animation_data::animationID, ComponentParameter::AsFloat(), ComponentParameter::AsInt(), ComponentParameter::AsString(), Animation_data::currentFrame, Animation_data::frameDuration, World::Get(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1505 of file PrefabFactory.cpp.
References World::AddComponent(), AttackIntent_data::Area, ComponentParameter::AsBool(), ComponentParameter::AsEntityRef(), ComponentParameter::AsFloat(), ComponentParameter::AsString(), ComponentParameter::AsVector(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), AttackIntent_data::Melee, AttackIntent_data::Ranged, SYSTEM_LOG, and AttackIntent_data::targetEntity.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1090 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsFloat(), ComponentParameter::AsString(), World::Get(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), AudioSource_data::soundEffectID, and AudioSource_data::volume.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1381 of file PrefabFactory.cpp.
References BehaviorTreeRuntime_data::AITreeAssetId, ComponentParameter::AsBool(), ComponentParameter::AsInt(), ComponentParameter::AsString(), BehaviorTreeManager::Get(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), BehaviorTreeManager::GetTree(), BehaviorTreeManager::GetTreeIdFromPath(), World::HasComponent(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 946 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsFloat(), BoundingBox_data::boundingBox, World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1194 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsFloat(), ComponentParameter::AsInt(), ComponentParameter::AsVector(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and Camera_data::playerId.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1251 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsFloat(), CameraBounds_data::boundingBox, World::Get(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and CameraBounds_data::useBounds.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1233 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsFloat(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and CameraEffects_data::isShaking.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1272 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsFloat(), ComponentParameter::AsInt(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and CameraInputBinding_data::playerId.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1215 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsEntityRef(), ComponentParameter::AsFloat(), CameraTarget_data::followTarget, World::Get(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), CameraTarget_data::smoothFactor, and CameraTarget_data::targetEntityID.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1036 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsFloat(), CollisionZone_data::bounds, World::Get(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and CollisionZone_data::isStatic.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:| bool PrefabFactory::InstantiateComponent | ( | EntityID | entity, |
| const ComponentDefinition & | componentDef | ||
| ) |
Instantiate a single component on an entity.
Component-agnostic instantiation method that works with any registered component type.
| entity | EntityID to add component to |
| componentDef | Component definition with type and parameters |
Definition at line 414 of file PrefabFactory.cpp.
References GetComponentTypeID_Static(), InstantiateAIBehavior(), InstantiateAIBlackboard(), InstantiateAISenses(), InstantiateAIState(), InstantiateAnimation(), InstantiateAttackIntent(), InstantiateAudioSource(), InstantiateBehaviorTreeRuntime(), InstantiateBoundingBox(), InstantiateCamera(), InstantiateCameraBounds(), InstantiateCameraEffects(), InstantiateCameraInputBinding(), InstantiateCameraTarget(), InstantiateCollisionZone(), InstantiateController(), InstantiateFX(), InstantiateHealth(), InstantiateIdentity(), InstantiateInputMapping(), InstantiateInventory(), InstantiateMoveIntent(), InstantiateMovement(), InstantiateNavigationAgent(), InstantiateNPC(), InstantiatePhysicsBody(), InstantiatePlayerBinding(), InstantiatePlayerController(), InstantiatePosition(), InstantiateTriggerZone(), InstantiateVisualAnimation(), InstantiateVisualEditor(), InstantiateVisualSprite(), m_componentFactories, and SYSTEM_LOG.
Referenced by CreateEntityFromBlueprint(), and CreateEntityWithOverrides().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1105 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsInt(), Controller_data::controllerID, World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1075 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsFloat(), ComponentParameter::AsString(), FX_data::effectType, World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1005 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsInt(), Health_data::currentHealth, World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 565 of file PrefabFactory.cpp.
References ComponentParameter::AsString(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), Identity_data::name, and StringToEntityType().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1290 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsFloat(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and InputMapping_data::InitializeDefaults().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1183 of file PrefabFactory.cpp.
References World::AddComponent(), World::Get(), and GetComponentTypeID_Static().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1459 of file PrefabFactory.cpp.
References ComponentParameter::AsBool(), ComponentParameter::AsFloat(), ComponentParameter::AsVector(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 973 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsFloat(), ComponentParameter::AsVector(), Movement_data::direction, World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1308 of file PrefabFactory.cpp.
References NavigationAgent_data::agentRadius, ComponentParameter::AsFloat(), ComponentParameter::AsInt(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and SYSTEM_LOG.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1171 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsString(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and NPC_data::npcType.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 628 of file PrefabFactory.cpp.
References ComponentParameter::AsBool(), ComponentParameter::AsFloat(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and PhysicsBody_data::mass.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1155 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsInt(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and PlayerBinding_data::playerIndex.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1125 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and PlayerController_data::isJumping.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 598 of file PrefabFactory.cpp.
References ComponentParameter::AsFloat(), ComponentParameter::AsVector(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and Position_data::position.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1021 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsFloat(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), ComponentDefinition::HasParameter(), and TriggerZone_data::radius.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 811 of file PrefabFactory.cpp.
References ComponentParameter::AsBool(), ComponentParameter::AsFloat(), ComponentParameter::AsString(), VisualAnimation_data::bankId, World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), and ComponentDefinition::HasParameter().
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 749 of file PrefabFactory.cpp.
References World::AddComponent(), ComponentParameter::AsBool(), ComponentParameter::AsColor(), ComponentParameter::AsString(), GameEntity, DataManager::Get(), World::Get(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), DataManager::GetSprite(), ComponentDefinition::HasParameter(), and SYSTEM_LOG.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 662 of file PrefabFactory.cpp.
References ComponentParameter::AsBool(), ComponentParameter::AsColor(), ComponentParameter::AsFloat(), ComponentParameter::AsString(), ComponentParameter::AsVector(), GameEntity, DataManager::Get(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), ComponentDefinition::GetParameter(), DataManager::GetSprite(), ComponentDefinition::HasParameter(), and SYSTEM_LOG.
Referenced by InstantiateComponent().
Here is the call graph for this function:
Here is the caller graph for this function:Check if a component is registered.
Definition at line 46 of file PrefabFactory.cpp.
References m_componentFactories.
Check if a type is registered.
| type | Type string to check (will be normalized) |
Definition at line 174 of file PrefabFactory.cpp.
References m_scanner.
| std::string PrefabFactory::NormalizeType | ( | const std::string & | type | ) | const |
Normalize a type string to canonical form.
| type | Type string to normalize |
Definition at line 156 of file PrefabFactory.cpp.
References m_scanner.
| void PrefabFactory::PreloadAllPrefabs | ( | const std::string & | prefabDirectory = "Blueprints/EntityPrefab" | ) |
Preload all prefabs from directory.
Scans and caches all prefab blueprints for fast entity creation. Should be called once at engine startup (World::Initialize).
| prefabDirectory | Path to prefab directory (default: "Blueprints/EntityPrefab") |
Definition at line 73 of file PrefabFactory.cpp.
References PrefabBlueprint::components, PrefabRegistry::Find(), PrefabRegistry::GetAllPrefabNames(), GetComponentTypeID_Static(), PrefabRegistry::GetCount(), m_prefabRegistry, m_prefabsPreloaded, m_scanner, and SYSTEM_LOG.
Referenced by World::Initialize_ECS_Systems().
Here is the call graph for this function:
Here is the caller graph for this function:| void PrefabFactory::RegisterComponentFactory | ( | const std::string & | componentName, |
| std::function< bool(EntityID, const ComponentDefinition &)> | factory | ||
| ) |
Register a component factory (called by auto-registration system)
Definition at line 31 of file PrefabFactory.cpp.
References GetComponentTypeID_Static(), and m_componentFactories.
Referenced by RegisterComponentFactory_Internal().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Register a legacy prefab builder function.
| name | Prefab name |
| builder | Function that builds the entity |
Definition at line 115 of file prefabfactory.h.
References GetComponentTypeID_Static(), m_prefabs, and SYSTEM_LOG.
Here is the call graph for this function:| void PrefabFactory::SetPrefabRegistry | ( | const PrefabRegistry & | registry | ) |
Set the prefab registry cache.
| registry | PrefabRegistry to use for lookups |
Definition at line 144 of file PrefabFactory.cpp.
References GetComponentTypeID_Static(), PrefabRegistry::GetCount(), m_prefabRegistry, m_prefabsPreloaded, and SYSTEM_LOG.
Here is the call graph for this function:
|
private |
Definition at line 218 of file prefabfactory.h.
Referenced by GetRegisteredComponents(), InstantiateComponent(), IsComponentRegistered(), and RegisterComponentFactory().
|
private |
Definition at line 213 of file prefabfactory.h.
Referenced by CreateEntityFromPrefabName(), GetPrefabCount(), GetPrefabRegistry(), HasPrefab(), PreloadAllPrefabs(), and SetPrefabRegistry().
|
private |
Definition at line 212 of file prefabfactory.h.
Referenced by CreateEntity(), and RegisterPrefab().
Definition at line 214 of file prefabfactory.h.
Referenced by CreateEntityFromPrefabName(), PreloadAllPrefabs(), and SetPrefabRegistry().
|
private |
Definition at line 215 of file prefabfactory.h.
Referenced by AreTypesEquivalent(), GetCanonicalInfo(), IsTypeRegistered(), NormalizeType(), and PreloadAllPrefabs().