Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
World Class Reference

Core ECS manager and world coordinator. More...

#include <World.h>

+ Collaboration diagram for World:

Classes

struct  InstantiationResult
 
struct  Phase2Result
 

Public Member Functions

 World ()
 Default constructor.
 
virtual ~World ()
 Destructor.
 
void Initialize_ECS_Systems ()
 
void Add_ECS_System (std::unique_ptr< ECS_System > system)
 
void Process_ECS_Systems ()
 
void Render_ECS_Systems ()
 
void RenderDebug_ECS_Systems ()
 
template<typename T >
TGetSystem ()
 
void Process ()
 
void Render ()
 
void AddLevel (std::unique_ptr< Level > level)
 
const std::vector< std::unique_ptr< Level > > & GetLevels () const
 
bool LoadLevelFromTiled (const std::string &tiledMapPath)
 
void UnloadCurrentLevel ()
 
bool LoadLevelDependencies (const nlohmann::json &levelJson)
 
void GenerateCollisionAndNavigationMaps (const Olympe::Tiled::TiledMap &tiledMap, const Olympe::Editor::LevelDefinition &levelDef)
 
EntityID CreateEntity ()
 
void DestroyEntity (EntityID entity)
 
bool IsEntityValid (EntityID entity) const
 
const std::vector< EntityID > & GetAllEntities () const
 Get all active entity IDs.
 
template<typename T , typename... Args>
TAddComponent (EntityID entity, Args &&... args)
 
template<typename T >
void RemoveComponent (EntityID entity)
 
template<typename T >
TGetComponent (EntityID entity)
 
template<typename T >
bool HasComponent (EntityID entity) const
 
RenderLayer GetDefaultLayerForType (EntityType type) const
 Get the default render layer for an entity type Automatically assigns appropriate layer based on entity classification.
 
void SetEntityLayer (EntityID entity, RenderLayer layer)
 Set entity render layer (updates position.z)
 
RenderLayer CalculateLayerFromZOrder (float zOrder) const
 Calculate layer index from zOrder value (for Tiled levels) Maps zOrder ranges to layer indices for proper depth sorting.
 
RenderLayer GetEntityLayer (EntityID entity) const
 Get entity render layer.
 
int GetNextCustomLayerIndex ()
 Get next available custom layer index (for dynamic layers)
 
void ToggleGrid ()
 Toggle grid visibility.
 
bool IsGridEnabled ()
 Get current grid state.
 
void ToggleCollisionOverlay ()
 Toggle collision overlay visibility.
 
void ToggleNavigationOverlay ()
 Toggle navigation overlay visibility.
 
bool IsCollisionOverlayVisible ()
 Get collision overlay state.
 
bool IsNavigationOverlayVisible ()
 Get navigation overlay state.
 
void SyncGridWithLevel (const Olympe::Editor::LevelDefinition &levelDef)
 Synchronize grid settings with loaded level Extracts map orientation and tile dimensions from LevelDefinition and updates GridSettings_data (projection mode, cellSize, hexRadius) Supports: orthogonal, isometric, hexagonal orientations.
 
const std::vector< TileChunk > & GetTileChunks () const
 
TilesetManagerGetTilesetManager ()
 
const std::string & GetMapOrientation () const
 
int GetTileWidth () const
 
int GetTileHeight () const
 
float GetIsometricOriginX () const
 
float GetIsometricOriginY () const
 
void SetMapBounds (int minTileX, int minTileY, int maxTileX, int maxTileY, int chunkOriginX, int chunkOriginY)
 
int GetChunkOriginX () const
 
int GetChunkOriginY () const
 
void LoadTileLayer (const nlohmann::json &layerJson, InstantiationResult &result)
 
void LoadTileChunk (const nlohmann::json &chunkJson, const std::string &layerName, int zOrder, const std::string &encoding)
 
void LoadTileData (const nlohmann::json &dataJson, const std::string &layerName, int width, int height, int zOrder, const std::string &encoding)
 

Static Public Member Functions

static WorldGetInstance ()
 Get singleton instance.
 
static WorldGet ()
 Get singleton instance (short form)
 

Public Attributes

std::unordered_map< EntityID, ComponentSignaturem_entitySignatures
 

Private Member Functions

void Notify_ECS_Systems (EntityID entity, ComponentSignature signature)
 
template<typename T >
void HandleSpecialComponentRegistration (EntityID entity, typename std::enable_if< std::is_same< T, PlayerBinding_data >::value >::type *=nullptr)
 
template<typename T >
void HandleSpecialComponentRegistration (EntityID entity, typename std::enable_if<!std::is_same< T, PlayerBinding_data >::value >::type *=nullptr)
 
void NotifyBlueprintEditorEntityCreated (EntityID entity)
 
void NotifyBlueprintEditorEntityDestroyed (EntityID entity)
 
void ValidateLevelPrefabs (const Olympe::Editor::LevelDefinition &levelDef)
 
bool InstantiatePass1_VisualLayers (const Olympe::Editor::LevelDefinition &levelDef, InstantiationResult &result)
 
bool InstantiatePass2_SpatialStructure (const Olympe::Editor::LevelDefinition &levelDef, InstantiationResult &result)
 
bool InstantiatePass5_Relationships (const Olympe::Editor::LevelDefinition &levelDef, InstantiationResult &result)
 
EntityID InstantiateEntity (const std::shared_ptr< Olympe::Editor::EntityInstance > &entityInstance, PrefabFactory &factory, InstantiationResult::PassStats &stats)
 Unified entity instantiation helper (used by all Phase 5 passes) Types are already normalized, performs direct lookup and instantiation.
 
void RegisterPlayerEntity (EntityID entity)
 Register a player entity that was loaded from a level file Validates required components and delegates to VideoGame for full setup.
 
void ExtractCustomProperties (const nlohmann::json &overrides, LevelInstanceParameters &instanceParams, const Olympe::Editor::EntityInstance *entityInstance=nullptr, const PrefabBlueprint *prefab=nullptr)
 Extract custom properties from JSON overrides into LevelInstanceParameters.
 
EntityID CreateMissingPrefabPlaceholder (const Olympe::Editor::EntityInstance &entityInstance, InstantiationResult::PassStats &stats)
 Create a red placeholder entity for missing prefabs.
 
std::string ExtractPrefabName (const std::string &prefabPath)
 Extract prefab name from prefab path (removes path and extension)
 

Private Attributes

std::unordered_map< ComponentTypeID, std::unique_ptr< IComponentPool > > m_componentPools
 
EntityID m_nextEntityID = 1
 
std::queue< EntityIDm_freeEntityIDs
 
std::vector< EntityIDm_entities
 
std::vector< std::unique_ptr< ECS_System > > m_systems
 
TilesetManager m_tilesetManager
 
std::vector< TileChunkm_tileChunks
 
std::string m_mapOrientation
 
int m_tileWidth
 
int m_tileHeight
 
std::vector< std::unique_ptr< Level > > m_levels
 
int m_minTileX = 0
 
int m_minTileY = 0
 
int m_maxTileX = 0
 
int m_maxTileY = 0
 
int m_chunkOriginX = 0
 
int m_chunkOriginY = 0
 
float m_cachedIsometricOriginX = 0.0f
 
float m_cachedIsometricOriginY = 0.0f
 
bool m_isometricOriginCached = false
 
int m_nextCustomLayerIndex = static_cast<int>(RenderLayer::Foreground_Far) + 1
 

Detailed Description

Core ECS manager and world coordinator.

The World class is the central hub for the Entity-Component-System architecture. It manages all entities, components, systems, and level loading.

Key features:

Note
Singleton class - use World::Get() to access
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 209 of file World.h.

Constructor & Destructor Documentation

◆ World()

World::World ( )

◆ ~World()

World::~World ( )
virtual

Destructor.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 82 of file World.cpp.

References SYSTEM_LOG.

Member Function Documentation

◆ Add_ECS_System()

void World::Add_ECS_System ( std::unique_ptr< ECS_System system)
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 170 of file World.cpp.

References GetComponentTypeID_Static(), and m_systems.

Referenced by Initialize_ECS_Systems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddComponent()

template<typename T , typename... Args>
T & World::AddComponent ( EntityID  entity,
Args &&...  args 
)
inline

◆ AddLevel()

void World::AddLevel ( std::unique_ptr< Level level)
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 279 of file World.h.

References GetComponentTypeID_Static(), and m_levels.

+ Here is the call graph for this function:

◆ CalculateLayerFromZOrder()

RenderLayer World::CalculateLayerFromZOrder ( float  zOrder) const

Calculate layer index from zOrder value (for Tiled levels) Maps zOrder ranges to layer indices for proper depth sorting.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 309 of file World.cpp.

References Background_Far, Background_Near, Characters, Effects, Flying, Foreground_Far, Foreground_Near, Ground, Objects, and UI_Near.

Referenced by InstantiateEntity().

+ Here is the caller graph for this function:

◆ CreateEntity()

EntityID World::CreateEntity ( )

◆ CreateMissingPrefabPlaceholder()

EntityID World::CreateMissingPrefabPlaceholder ( const Olympe::Editor::EntityInstance entityInstance,
InstantiationResult::PassStats stats 
)
private

◆ DestroyEntity()

void World::DestroyEntity ( EntityID  entity)

◆ ExtractCustomProperties()

void World::ExtractCustomProperties ( const nlohmann::json overrides,
LevelInstanceParameters instanceParams,
const Olympe::Editor::EntityInstance entityInstance = nullptr,
const PrefabBlueprint prefab = nullptr 
)
private

Extract custom properties from JSON overrides into LevelInstanceParameters.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 2469 of file World.cpp.

References ComponentParameter::FromBool(), ComponentParameter::FromFloat(), ComponentParameter::FromInt(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by InstantiateEntity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractPrefabName()

std::string World::ExtractPrefabName ( const std::string &  prefabPath)
private

Extract prefab name from prefab path (removes path and extension)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 2760 of file World.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GenerateCollisionAndNavigationMaps()

void World::GenerateCollisionAndNavigationMaps ( const Olympe::Tiled::TiledMap tiledMap,
const Olympe::Editor::LevelDefinition levelDef 
)

◆ Get()

static World & World::Get ( )
inlinestatic

Get singleton instance (short form)

Returns
Reference to World singleton
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 232 of file World.h.

References GetInstance().

Referenced by ObjectFactory::AddComponent(), VideoGame::AddPlayerEntity(), CameraSystem::ApplyCameraBounds(), CameraSystem::ApplyCameraToRenderer(), CameraSystem::BindCameraToJoystick(), CameraSystem::BindCameraToKeyboard(), InputsManager::BindControllerToPlayer(), CameraSystem::ClearCameraTarget(), CameraSystem::CreateCameraForPlayer(), PrefabFactory::CreateEntity(), PrefabFactory::CreateEntityFromBlueprint(), PrefabFactory::CreateEntityWithOverrides(), CreateMissingPrefabPlaceholder(), ObjectFactory::CreateObject(), ExecuteBTAction(), ExecuteBTCondition(), GridSystem::FindSettings(), NavigationSystem::FollowPath(), CameraEventHandler::FollowTarget(), GetActiveCameraTransform(), Olympe::EntityInspectorManager::GetComponentProperties(), GetEntityLayer(), ObjectFactory::GetWorldObjectList(), CameraEventHandler::HandleClearBoundsEvent(), Olympe::BehaviorTreeDebugWindow::HandleNodeCreation(), CameraEventHandler::HandleResetEvent(), CameraEventHandler::HandleRotateEvent(), CameraEventHandler::HandleShakeEvent(), CameraEventHandler::HandleShakeStopEvent(), CameraEventHandler::HandleTeleportEvent(), CameraEventHandler::HandleUnfollowEvent(), CameraEventHandler::HandleZoomEvent(), GameEngine::Initialize(), VideoGame::InitializeAITestScene(), PrefabFactory::InstantiateAIBehavior(), PrefabFactory::InstantiateAIBlackboard(), PrefabFactory::InstantiateAISenses(), PrefabFactory::InstantiateAIState(), PrefabFactory::InstantiateAnimation(), PrefabFactory::InstantiateAttackIntent(), PrefabFactory::InstantiateAudioSource(), PrefabFactory::InstantiateBehaviorTreeRuntime(), PrefabFactory::InstantiateBoundingBox(), PrefabFactory::InstantiateCamera(), PrefabFactory::InstantiateCameraBounds(), PrefabFactory::InstantiateCameraEffects(), PrefabFactory::InstantiateCameraInputBinding(), PrefabFactory::InstantiateCameraTarget(), PrefabFactory::InstantiateCollisionZone(), InstantiateComponentGeneric(), PrefabFactory::InstantiateController(), PrefabFactory::InstantiateFX(), PrefabFactory::InstantiateHealth(), PrefabFactory::InstantiateIdentity(), PrefabFactory::InstantiateInputMapping(), PrefabFactory::InstantiateInventory(), PrefabFactory::InstantiateMoveIntent(), PrefabFactory::InstantiateMovement(), PrefabFactory::InstantiateNavigationAgent(), PrefabFactory::InstantiateNPC(), PrefabFactory::InstantiatePhysicsBody(), PrefabFactory::InstantiatePlayerBinding(), PrefabFactory::InstantiatePlayerController(), PrefabFactory::InstantiatePosition(), PrefabFactory::InstantiateTriggerZone(), PrefabFactory::InstantiateVisualAnimation(), PrefabFactory::InstantiateVisualEditor(), PrefabFactory::InstantiateVisualSprite(), AIPerceptionSystem::IsTargetVisible(), Olympe::EntityInspectorManager::OnEntityCreated(), CameraSystem::OnEvent(), AnimationSystem::PauseAnimation(), AnimationSystem::PlayAnimation(), InputEventConsumeSystem::Process(), CameraEventConsumeSystem::Process(), NavigationSystem::Process(), MovementSystem::Process(), PlayerControlSystem::Process(), InputMappingSystem::Process(), AIPerceptionSystem::Process(), AIStateTransitionSystem::Process(), BehaviorTreeSystem::Process(), AIMotionSystem::Process(), AnimationSystem::Process(), Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), VideoGame::RegisterLoadedPlayerEntity(), CameraSystem::RemoveCameraForPlayer(), RenderingSystem::Render(), RenderingEditorSystem::Render(), Olympe::BehaviorTreeDebugWindow::RenderBehaviorTreeGraph(), Olympe::BehaviorTreeDebugWindow::RenderBlackboardSection(), RenderEntitiesForCamera(), GameMenu::RenderF2Menu(), UIRenderingSystem::RenderHUD(), Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow(), Olympe::BehaviorTreeDebugWindow::RenderMinimap(), RenderMultiLayerForCamera(), Olympe::BehaviorTreeDebugWindow::RenderNodeGraphPanel(), Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo(), RenderSingleEntity(), NavigationSystem::RequestPath(), CameraSystem::ResetCameraControls(), Olympe::BehaviorTreeDebugWindow::ResetZoom(), AnimationSystem::ResumeAnimation(), SDL_AppIterate(), CameraEventHandler::SetCameraBounds(), CameraSystem::SetCameraTarget_ECS(), Olympe::EntityInspectorManager::SetComponentProperty(), AnimationSystem::SetPlaybackSpeed(), AnimationSystem::StopAnimation(), Olympe::EntityInspectorManager::SyncWithWorld(), CameraSystem::UnbindCameraKeyboard(), InputsManager::UnbindControllerFromPlayer(), AIStateTransitionSystem::UpdateAIState(), CameraSystem::UpdateCameraFollow(), CameraSystem::UpdateCameraInput(), CameraSystem::UpdateCameraRotation(), CameraSystem::UpdateCameraShake(), and CameraSystem::UpdateCameraZoom().

+ Here is the call graph for this function:

◆ GetAllEntities()

const std::vector< EntityID > & World::GetAllEntities ( ) const
inline

Get all active entity IDs.

Returns
Vector of all entity IDs in the world
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 384 of file World.h.

References m_entities.

◆ GetChunkOriginX()

int World::GetChunkOriginX ( ) const
inline

◆ GetChunkOriginY()

int World::GetChunkOriginY ( ) const
inline

◆ GetComponent()

template<typename T >
T & World::GetComponent ( EntityID  entity)
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 438 of file World.h.

References ComponentPool< T >::GetComponent(), GetComponentTypeID_Static(), and m_componentPools.

Referenced by VideoGame::AddPlayerEntity(), CameraSystem::ApplyCameraBounds(), CameraSystem::ApplyCameraToRenderer(), CameraSystem::BindCameraToJoystick(), CameraSystem::BindCameraToKeyboard(), InputsManager::BindControllerToPlayer(), CameraSystem::ClearCameraTarget(), PrefabFactory::CreateEntityFromBlueprint(), PrefabFactory::CreateEntityWithOverrides(), ExecuteBTAction(), ExecuteBTCondition(), GridSystem::FindSettings(), NavigationSystem::FollowPath(), GetActiveCameraTransform(), Olympe::EntityInspectorManager::GetComponentProperties(), GetEntityLayer(), CameraEventHandler::HandleClearBoundsEvent(), CameraEventHandler::HandleResetEvent(), CameraEventHandler::HandleRotateEvent(), CameraEventHandler::HandleShakeEvent(), CameraEventHandler::HandleShakeStopEvent(), CameraEventHandler::HandleTeleportEvent(), CameraEventHandler::HandleZoomEvent(), VideoGame::InitializeAITestScene(), PrefabFactory::InstantiateAIBlackboard(), PrefabFactory::InstantiateAISenses(), PrefabFactory::InstantiateBehaviorTreeRuntime(), InstantiateComponentGeneric(), PrefabFactory::InstantiateIdentity(), PrefabFactory::InstantiateMoveIntent(), PrefabFactory::InstantiateNavigationAgent(), PrefabFactory::InstantiatePhysicsBody(), PrefabFactory::InstantiatePosition(), PrefabFactory::InstantiateVisualAnimation(), PrefabFactory::InstantiateVisualSprite(), AIPerceptionSystem::IsTargetVisible(), Olympe::EntityInspectorManager::OnEntityCreated(), CameraSystem::OnEvent(), AnimationSystem::PauseAnimation(), AnimationSystem::PlayAnimation(), InputEventConsumeSystem::Process(), NavigationSystem::Process(), MovementSystem::Process(), PlayerControlSystem::Process(), InputMappingSystem::Process(), AIPerceptionSystem::Process(), AIStateTransitionSystem::Process(), BehaviorTreeSystem::Process(), AIMotionSystem::Process(), AnimationSystem::Process(), VideoGame::RegisterLoadedPlayerEntity(), RenderingEditorSystem::Render(), RenderEntitiesForCamera(), UIRenderingSystem::RenderHUD(), RenderMultiLayerForCamera(), RenderSingleEntity(), NavigationSystem::RequestPath(), CameraSystem::ResetCameraControls(), AnimationSystem::ResumeAnimation(), CameraEventHandler::SetCameraBounds(), CameraSystem::SetCameraTarget_ECS(), Olympe::EntityInspectorManager::SetComponentProperty(), AnimationSystem::SetPlaybackSpeed(), AnimationSystem::StopAnimation(), CameraSystem::UnbindCameraKeyboard(), InputsManager::UnbindControllerFromPlayer(), AIStateTransitionSystem::UpdateAIState(), CameraSystem::UpdateCameraFollow(), CameraSystem::UpdateCameraInput(), CameraSystem::UpdateCameraRotation(), CameraSystem::UpdateCameraShake(), and CameraSystem::UpdateCameraZoom().

+ Here is the call graph for this function:

◆ GetDefaultLayerForType()

RenderLayer World::GetDefaultLayerForType ( EntityType  type) const
inline

Get the default render layer for an entity type Automatically assigns appropriate layer based on entity classification.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 473 of file World.h.

References Background, Background_Near, Characters, Collectible, Dynamic, Effect, Effects, Enemy, Ground, Item, None, NPC, Objects, Particle, Player, Static, Trigger, UI_Near, UIElement, and Waypoint.

Referenced by PrefabFactory::CreateEntityFromBlueprint(), and PrefabFactory::CreateEntityWithOverrides().

+ Here is the caller graph for this function:

◆ GetEntityLayer()

RenderLayer World::GetEntityLayer ( EntityID  entity) const

Get entity render layer.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 334 of file World.cpp.

References Get(), GetComponent(), GetComponentTypeID_Static(), Ground, and ZToLayer().

+ Here is the call graph for this function:

◆ GetInstance()

static World & World::GetInstance ( )
inlinestatic

Get singleton instance.

Returns
Reference to World singleton
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 222 of file World.h.

References GetComponentTypeID_Static().

Referenced by Get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetIsometricOriginX()

float World::GetIsometricOriginX ( ) const

◆ GetIsometricOriginY()

float World::GetIsometricOriginY ( ) const

◆ GetLevels()

const std::vector< std::unique_ptr< Level > > & World::GetLevels ( ) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 284 of file World.h.

References m_levels.

◆ GetMapOrientation()

const std::string & World::GetMapOrientation ( ) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 736 of file World.h.

References m_mapOrientation.

Referenced by RenderMultiLayerForCamera().

+ Here is the caller graph for this function:

◆ GetNextCustomLayerIndex()

int World::GetNextCustomLayerIndex ( )
inline

Get next available custom layer index (for dynamic layers)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 521 of file World.h.

References m_nextCustomLayerIndex.

◆ GetSystem()

template<typename T >
T * World::GetSystem ( )
inline

◆ GetTileChunks()

const std::vector< TileChunk > & World::GetTileChunks ( ) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 730 of file World.h.

References m_tileChunks.

Referenced by RenderMultiLayerForCamera().

+ Here is the caller graph for this function:

◆ GetTileHeight()

int World::GetTileHeight ( ) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 738 of file World.h.

References m_tileHeight.

Referenced by RenderMultiLayerForCamera().

+ Here is the caller graph for this function:

◆ GetTilesetManager()

TilesetManager & World::GetTilesetManager ( )
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 733 of file World.h.

References m_tilesetManager.

Referenced by RenderMultiLayerForCamera().

+ Here is the caller graph for this function:

◆ GetTileWidth()

int World::GetTileWidth ( ) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 737 of file World.h.

References m_tileWidth.

Referenced by RenderMultiLayerForCamera().

+ Here is the caller graph for this function:

◆ HandleSpecialComponentRegistration() [1/2]

template<typename T >
void World::HandleSpecialComponentRegistration ( EntityID  entity,
typename std::enable_if< std::is_same< T, PlayerBinding_data >::value >::type *  = nullptr 
)
inlineprivate
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 656 of file World.h.

References GetComponentTypeID_Static(), and RegisterInputEntityWithManager().

+ Here is the call graph for this function:

◆ HandleSpecialComponentRegistration() [2/2]

template<typename T >
void World::HandleSpecialComponentRegistration ( EntityID  entity,
typename std::enable_if<!std::is_same< T, PlayerBinding_data >::value >::type *  = nullptr 
)
inlineprivate

Definition at line 663 of file World.h.

◆ HasComponent()

template<typename T >
bool World::HasComponent ( EntityID  entity) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 451 of file World.h.

References GetComponentTypeID_Static(), ComponentPool< T >::HasComponent(), m_componentPools, and m_entitySignatures.

Referenced by VideoGame::AddPlayerEntity(), CameraSystem::ApplyCameraBounds(), CameraSystem::ClearCameraTarget(), PrefabFactory::CreateEntityFromBlueprint(), PrefabFactory::CreateEntityWithOverrides(), ExecuteBTAction(), ExecuteBTCondition(), GridSystem::FindSettings(), GetActiveCameraTransform(), Olympe::EntityInspectorManager::GetComponentProperties(), CameraEventHandler::HandleClearBoundsEvent(), CameraEventHandler::HandleResetEvent(), CameraEventHandler::HandleRotateEvent(), CameraEventHandler::HandleShakeEvent(), CameraEventHandler::HandleShakeStopEvent(), CameraEventHandler::HandleTeleportEvent(), CameraEventHandler::HandleZoomEvent(), PrefabFactory::InstantiateBehaviorTreeRuntime(), AnimationSystem::PauseAnimation(), AnimationSystem::PlayAnimation(), InputEventConsumeSystem::Process(), AIPerceptionSystem::Process(), BehaviorTreeSystem::Process(), AIMotionSystem::Process(), AnimationSystem::Process(), VideoGame::RegisterLoadedPlayerEntity(), UIRenderingSystem::RenderHUD(), RenderMultiLayerForCamera(), CameraSystem::ResetCameraControls(), AnimationSystem::ResumeAnimation(), CameraEventHandler::SetCameraBounds(), CameraSystem::SetCameraTarget_ECS(), Olympe::EntityInspectorManager::SetComponentProperty(), AnimationSystem::SetPlaybackSpeed(), AnimationSystem::StopAnimation(), AIStateTransitionSystem::UpdateAIState(), and CameraSystem::UpdateCameraFollow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Initialize_ECS_Systems()

void World::Initialize_ECS_Systems ( )

◆ InstantiateEntity()

EntityID World::InstantiateEntity ( const std::shared_ptr< Olympe::Editor::EntityInstance > &  entityInstance,
PrefabFactory factory,
InstantiationResult::PassStats stats 
)
private

Unified entity instantiation helper (used by all Phase 5 passes) Types are already normalized, performs direct lookup and instantiation.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 1387 of file World.cpp.

References CalculateLayerFromZOrder(), CreateMissingPrefabPlaceholder(), ExtractCustomProperties(), World::InstantiationResult::PassStats::failed, World::InstantiationResult::PassStats::failedObjects, VideoGame::Get(), GetComponentTypeID_Static(), INVALID_ENTITY_ID, RegisterPlayerEntity(), World::InstantiationResult::PassStats::successfullyCreated, SYSTEM_LOG, and World::InstantiationResult::PassStats::totalObjects.

Referenced by LoadLevelFromTiled().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InstantiatePass1_VisualLayers()

bool World::InstantiatePass1_VisualLayers ( const Olympe::Editor::LevelDefinition levelDef,
InstantiationResult result 
)
private

◆ InstantiatePass2_SpatialStructure()

bool World::InstantiatePass2_SpatialStructure ( const Olympe::Editor::LevelDefinition levelDef,
InstantiationResult result 
)
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 2248 of file World.cpp.

Referenced by LoadLevelFromTiled().

+ Here is the caller graph for this function:

◆ InstantiatePass5_Relationships()

bool World::InstantiatePass5_Relationships ( const Olympe::Editor::LevelDefinition levelDef,
InstantiationResult result 
)
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 2270 of file World.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by LoadLevelFromTiled().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsCollisionOverlayVisible()

bool World::IsCollisionOverlayVisible ( )
inline

Get collision overlay state.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 600 of file World.h.

References GetComponentTypeID_Static(), and m_entitySignatures.

+ Here is the call graph for this function:

◆ IsEntityValid()

bool World::IsEntityValid ( EntityID  entity) const
inline

◆ IsGridEnabled()

bool World::IsGridEnabled ( )
inline

Get current grid state.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 549 of file World.h.

References GetComponentTypeID_Static(), and m_entitySignatures.

+ Here is the call graph for this function:

◆ IsNavigationOverlayVisible()

bool World::IsNavigationOverlayVisible ( )
inline

Get navigation overlay state.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 615 of file World.h.

References GetComponentTypeID_Static(), and m_entitySignatures.

+ Here is the call graph for this function:

◆ LoadLevelDependencies()

bool World::LoadLevelDependencies ( const nlohmann::json levelJson)

◆ LoadLevelFromTiled()

bool World::LoadLevelFromTiled ( const std::string &  tiledMapPath)

◆ LoadTileChunk()

void World::LoadTileChunk ( const nlohmann::json chunkJson,
const std::string &  layerName,
int  zOrder,
const std::string &  encoding 
)
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 1682 of file World.cpp.

References Olympe::Tiled::TiledDecoder::DecodeTileData(), GetComponentTypeID_Static(), TileChunk::layerName, and m_tileChunks.

Referenced by LoadTileLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadTileData()

void World::LoadTileData ( const nlohmann::json dataJson,
const std::string &  layerName,
int  width,
int  height,
int  zOrder,
const std::string &  encoding 
)
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 1737 of file World.cpp.

References Olympe::Tiled::TiledDecoder::DecodeTileData(), GetComponentTypeID_Static(), TileChunk::layerName, and m_tileChunks.

Referenced by LoadTileLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadTileLayer()

void World::LoadTileLayer ( const nlohmann::json layerJson,
InstantiationResult result 
)
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 1632 of file World.cpp.

References GetComponentTypeID_Static(), LoadTileChunk(), and LoadTileData().

Referenced by InstantiatePass1_VisualLayers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Notify_ECS_Systems()

void World::Notify_ECS_Systems ( EntityID  entity,
ComponentSignature  signature 
)
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 206 of file World.cpp.

References GetComponentTypeID_Static(), and m_systems.

Referenced by AddComponent(), DestroyEntity(), and RemoveComponent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyBlueprintEditorEntityCreated()

void World::NotifyBlueprintEditorEntityCreated ( EntityID  entity)
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 347 of file World.cpp.

References GetComponentTypeID_Static(), and NotifyEditorEntityCreated().

Referenced by CreateEntity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyBlueprintEditorEntityDestroyed()

void World::NotifyBlueprintEditorEntityDestroyed ( EntityID  entity)
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 355 of file World.cpp.

References GetComponentTypeID_Static(), and NotifyEditorEntityDestroyed().

Referenced by DestroyEntity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Process()

void World::Process ( )
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 257 of file World.h.

References EventQueue::BeginFrame(), GameState_Paused, EventQueue::Get(), GetComponentTypeID_Static(), GameStateManager::GetState(), and Process_ECS_Systems().

Referenced by SDL_AppIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Process_ECS_Systems()

void World::Process_ECS_Systems ( )
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 176 of file World.cpp.

References GetComponentTypeID_Static(), and m_systems.

Referenced by Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterPlayerEntity()

void World::RegisterPlayerEntity ( EntityID  entity)
private

Register a player entity that was loaded from a level file Validates required components and delegates to VideoGame for full setup.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 2777 of file World.cpp.

References VideoGame::Get(), GetComponentTypeID_Static(), VideoGame::RegisterLoadedPlayerEntity(), and SYSTEM_LOG.

Referenced by InstantiateEntity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveComponent()

template<typename T >
void World::RemoveComponent ( EntityID  entity)
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 422 of file World.h.

References GetComponentTypeID_Static(), m_componentPools, m_entitySignatures, and Notify_ECS_Systems().

+ Here is the call graph for this function:

◆ Render()

void World::Render ( )
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 271 of file World.h.

References Render_ECS_Systems(), and RenderDebug_ECS_Systems().

Referenced by SDL_AppIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Render_ECS_Systems()

void World::Render_ECS_Systems ( )
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 185 of file World.cpp.

References ViewportManager::Get(), GetComponentTypeID_Static(), m_systems, and ViewportManager::Render().

Referenced by Render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderDebug_ECS_Systems()

void World::RenderDebug_ECS_Systems ( )
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 196 of file World.cpp.

References GetComponentTypeID_Static(), and m_systems.

Referenced by Render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetEntityLayer()

void World::SetEntityLayer ( EntityID  entity,
RenderLayer  layer 
)

Set entity render layer (updates position.z)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 292 of file World.cpp.

References GetComponentTypeID_Static(), LayerToZ(), and SYSTEM_LOG.

Referenced by PrefabFactory::CreateEntityFromBlueprint(), and PrefabFactory::CreateEntityWithOverrides().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetMapBounds()

void World::SetMapBounds ( int  minTileX,
int  minTileY,
int  maxTileX,
int  maxTileY,
int  chunkOriginX,
int  chunkOriginY 
)
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 2795 of file World.cpp.

References GetComponentTypeID_Static(), m_chunkOriginX, m_chunkOriginY, m_isometricOriginCached, m_maxTileX, m_maxTileY, m_minTileX, m_minTileY, and SYSTEM_LOG.

Referenced by InstantiatePass1_VisualLayers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SyncGridWithLevel()

void World::SyncGridWithLevel ( const Olympe::Editor::LevelDefinition levelDef)

Synchronize grid settings with loaded level Extracts map orientation and tile dimensions from LevelDefinition and updates GridSettings_data (projection mode, cellSize, hexRadius) Supports: orthogonal, isometric, hexagonal orientations.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 364 of file World.cpp.

References GetComponentTypeID_Static(), HexAxial, Iso, m_entitySignatures, Ortho, and SYSTEM_LOG.

Referenced by LoadLevelFromTiled().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToggleCollisionOverlay()

void World::ToggleCollisionOverlay ( )
inline

Toggle collision overlay visibility.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 564 of file World.h.

References GetComponentTypeID_Static(), m_entitySignatures, and SYSTEM_LOG.

Referenced by InputEventConsumeSystem::Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToggleGrid()

void World::ToggleGrid ( )
inline

Toggle grid visibility.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 531 of file World.h.

References GetComponentTypeID_Static(), m_entitySignatures, and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ ToggleNavigationOverlay()

void World::ToggleNavigationOverlay ( )
inline

Toggle navigation overlay visibility.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 582 of file World.h.

References GetComponentTypeID_Static(), m_entitySignatures, and SYSTEM_LOG.

Referenced by InputEventConsumeSystem::Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnloadCurrentLevel()

void World::UnloadCurrentLevel ( )
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 1302 of file World.cpp.

References TilesetManager::Clear(), DestroyEntity(), GetComponentTypeID_Static(), m_entities, m_entitySignatures, m_tileChunks, m_tilesetManager, and SYSTEM_LOG.

Referenced by LoadLevelFromTiled().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateLevelPrefabs()

void World::ValidateLevelPrefabs ( const Olympe::Editor::LevelDefinition levelDef)
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 1361 of file World.cpp.

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

Referenced by LoadLevelFromTiled().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cachedIsometricOriginX

float World::m_cachedIsometricOriginX = 0.0f
mutableprivate

◆ m_cachedIsometricOriginY

float World::m_cachedIsometricOriginY = 0.0f
mutableprivate

◆ m_chunkOriginX

int World::m_chunkOriginX = 0
private

◆ m_chunkOriginY

int World::m_chunkOriginY = 0
private

◆ m_componentPools

std::unordered_map<ComponentTypeID, std::unique_ptr<IComponentPool> > World::m_componentPools
private

◆ m_entities

std::vector<EntityID> World::m_entities
private

◆ m_entitySignatures

std::unordered_map<EntityID, ComponentSignature> World::m_entitySignatures

◆ m_freeEntityIDs

std::queue<EntityID> World::m_freeEntityIDs
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 644 of file World.h.

Referenced by DestroyEntity().

◆ m_isometricOriginCached

bool World::m_isometricOriginCached = false
mutableprivate

◆ m_levels

std::vector<std::unique_ptr<Level> > World::m_levels
private
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 766 of file World.h.

Referenced by AddLevel(), and GetLevels().

◆ m_mapOrientation

std::string World::m_mapOrientation
private

◆ m_maxTileX

int World::m_maxTileX = 0
private

◆ m_maxTileY

int World::m_maxTileY = 0
private

◆ m_minTileX

int World::m_minTileX = 0
private

◆ m_minTileY

int World::m_minTileY = 0
private

◆ m_nextCustomLayerIndex

int World::m_nextCustomLayerIndex = static_cast<int>(RenderLayer::Foreground_Far) + 1
private

◆ m_nextEntityID

EntityID World::m_nextEntityID = 1
private

◆ m_systems

std::vector<std::unique_ptr<ECS_System> > World::m_systems
private

◆ m_tileChunks

std::vector<TileChunk> World::m_tileChunks
private

◆ m_tileHeight

int World::m_tileHeight
private

◆ m_tilesetManager

TilesetManager World::m_tilesetManager
private

◆ m_tileWidth

int World::m_tileWidth
private

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