118 SYSTEM_LOG <<
"PrefabFactory::RegisteredPrefab has registered: " << name <<
"\n";
266#define REGISTER_PREFAB(Name, BuilderLambda) \
268 struct AutoRegister##Name { \
269 AutoRegister##Name() { \
270 PrefabFactory::Get().RegisterPrefab(#Name, BuilderLambda); \
273 AutoRegister##Name global_##Name; \
ComponentTypeID GetComponentTypeID_Static()
Factory class for creating entities from prefab blueprints.
const PrefabRegistry & GetPrefabRegistry() const
Get the cached prefab registry.
bool InstantiatePosition(EntityID entity, const ComponentDefinition &def)
bool InstantiateAIBehavior(EntityID entity, const ComponentDefinition &def)
void RegisterComponentFactory(const std::string &componentName, std::function< bool(EntityID, const ComponentDefinition &)> factory)
Register a component factory (called by auto-registration system)
bool InstantiateComponent(EntityID entity, const ComponentDefinition &componentDef)
Instantiate a single component on an entity.
bool InstantiateAttackIntent(EntityID entity, const ComponentDefinition &def)
bool InstantiateAudioSource(EntityID entity, const ComponentDefinition &def)
bool InstantiateCameraEffects(EntityID entity, const ComponentDefinition &def)
std::unique_ptr< PrefabScanner > m_scanner
std::map< std::string, std::function< bool(EntityID, const ComponentDefinition &)> > m_componentFactories
bool InstantiateCameraBounds(EntityID entity, const ComponentDefinition &def)
bool IsComponentRegistered(const std::string &componentName) const
Check if a component is registered.
bool InstantiatePhysicsBody(EntityID entity, const ComponentDefinition &def)
int GetPrefabCount() const
Create entity from prefab name with explicit layer override.
bool InstantiateCamera(EntityID entity, const ComponentDefinition &def)
bool InstantiatePlayerController(EntityID entity, const ComponentDefinition &def)
std::string NormalizeType(const std::string &type) const
Normalize a type string to canonical form.
bool InstantiateAIBlackboard(EntityID entity, const ComponentDefinition &def)
PrefabRegistry m_prefabRegistry
bool AreTypesEquivalent(const std::string &type1, const std::string &type2) const
Check if two types are equivalent.
bool InstantiateController(EntityID entity, const ComponentDefinition &def)
bool GetCanonicalInfo(const std::string &type, std::string &outCanonical, std::string &outPrefabFile) const
Get canonical type info for debugging.
void SetPrefabRegistry(const PrefabRegistry ®istry)
Set the prefab registry cache.
bool IsTypeRegistered(const std::string &type) const
Check if a type is registered.
bool InstantiateBoundingBox(EntityID entity, const ComponentDefinition &def)
EntityID CreateEntityWithOverrides(const PrefabBlueprint &blueprint, const LevelInstanceParameters &instanceParams, bool autoAssignLayer=true)
Create entity from blueprint with level instance parameter overrides.
bool InstantiateVisualSprite(EntityID entity, const ComponentDefinition &def)
bool InstantiateVisualAnimation(EntityID entity, const ComponentDefinition &def)
bool InstantiateMoveIntent(EntityID entity, const ComponentDefinition &def)
std::vector< std::string > GetRegisteredComponents() const
Get list of all registered components (for debugging)
bool InstantiatePlayerBinding(EntityID entity, const ComponentDefinition &def)
bool InstantiateBehaviorTreeRuntime(EntityID entity, const ComponentDefinition &def)
EntityID CreateEntityFromBlueprint(const PrefabBlueprint &blueprint, bool autoAssignLayer=true)
Create entity from a parsed blueprint.
bool InstantiateCollisionZone(EntityID entity, const ComponentDefinition &def)
std::map< std::string, PrefabBuilder > m_prefabs
bool InstantiateVisualEditor(EntityID entity, const ComponentDefinition &def)
bool InstantiateFX(EntityID entity, const ComponentDefinition &def)
bool InstantiateAIState(EntityID entity, const ComponentDefinition &def)
static PrefabFactory & Get()
Get singleton instance.
bool InstantiateInputMapping(EntityID entity, const ComponentDefinition &def)
bool InstantiateNavigationAgent(EntityID entity, const ComponentDefinition &def)
bool InstantiateCameraInputBinding(EntityID entity, const ComponentDefinition &def)
bool InstantiateAISenses(EntityID entity, const ComponentDefinition &def)
bool InstantiateIdentity(EntityID entity, const ComponentDefinition &def)
EntityID CreateEntity(const std::string &prefabName)
Create an entity using legacy prefab system.
void RegisterPrefab(const std::string &name, PrefabBuilder builder)
Register a legacy prefab builder function.
EntityID CreateEntityFromPrefabName(const std::string &prefabName)
Create entity from prefab name.
bool InstantiateAnimation(EntityID entity, const ComponentDefinition &def)
bool InstantiateHealth(EntityID entity, const ComponentDefinition &def)
bool InstantiateNPC(EntityID entity, const ComponentDefinition &def)
void PreloadAllPrefabs(const std::string &prefabDirectory="Blueprints/EntityPrefab")
Preload all prefabs from directory.
bool InstantiateTriggerZone(EntityID entity, const ComponentDefinition &def)
bool InstantiateMovement(EntityID entity, const ComponentDefinition &def)
bool InstantiateInventory(EntityID entity, const ComponentDefinition &def)
bool InstantiateCameraTarget(EntityID entity, const ComponentDefinition &def)
bool HasPrefab(const std::string &prefabName) const
Check if prefab exists.
const PrefabBlueprint * Find(const std::string &name) const
void RegisterComponentFactory_Internal(const char *componentName, std::function< bool(EntityID, const ComponentDefinition &)> factory)
std::function< void(EntityID)> PrefabBuilder