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

EntityInspectorManager - Manages runtime entity tracking and inspection Singleton that maintains a synchronized list of all entities in the world. More...

#include <EntityInspectorManager.h>

Public Member Functions

void Initialize ()
 
void Shutdown ()
 
void Update ()
 
void OnEntityCreated (EntityID entity)
 
void OnEntityDestroyed (EntityID entity)
 
void OnComponentAdded (EntityID entity, const std::string &componentType)
 
void OnComponentRemoved (EntityID entity, const std::string &componentType)
 
std::vector< EntityIDGetAllEntities () const
 
std::vector< EntityInfoGetAllEntityInfo () const
 
EntityInfo GetEntityInfo (EntityID entity) const
 
bool IsEntityValid (EntityID entity) const
 
std::vector< std::string > GetEntityComponents (EntityID entity) const
 
bool HasComponent (EntityID entity, const std::string &componentType) const
 
std::vector< ComponentPropertyInfoGetComponentProperties (EntityID entity, const std::string &componentType)
 
bool SetComponentProperty (EntityID entity, const std::string &componentType, const std::string &propertyName, const std::string &value)
 
std::vector< EntityIDFilterByName (const std::string &nameFilter) const
 
std::vector< EntityIDFilterByComponent (const std::string &componentType) const
 
void SetSelectedEntity (EntityID entity)
 
EntityID GetSelectedEntity () const
 
bool HasSelection () const
 
bool IsInitialized () const
 
size_t GetEntityCount () const
 
void ForceSyncWithWorld ()
 

Static Public Member Functions

static EntityInspectorManagerInstance ()
 
static EntityInspectorManagerGet ()
 

Private Member Functions

 EntityInspectorManager ()
 
 ~EntityInspectorManager ()
 
 EntityInspectorManager (const EntityInspectorManager &)=delete
 
EntityInspectorManageroperator= (const EntityInspectorManager &)=delete
 
void SyncWithWorld ()
 
std::string GetComponentName (ComponentTypeID typeId) const
 
ComponentTypeID GetComponentTypeId (const std::string &name) const
 

Private Attributes

bool m_Initialized = false
 
EntityID m_SelectedEntity = INVALID_ENTITY_ID
 
std::vector< EntityIDm_EntityList
 
std::map< EntityID, EntityInfom_EntityInfoCache
 

Detailed Description

EntityInspectorManager - Manages runtime entity tracking and inspection Singleton that maintains a synchronized list of all entities in the world.

Definition at line 48 of file EntityInspectorManager.h.

Constructor & Destructor Documentation

◆ EntityInspectorManager() [1/2]

Olympe::EntityInspectorManager::EntityInspectorManager ( )
private

Definition at line 19 of file EntityInspectorManager.cpp.

◆ ~EntityInspectorManager()

Olympe::EntityInspectorManager::~EntityInspectorManager ( )
private

Definition at line 23 of file EntityInspectorManager.cpp.

References Shutdown().

+ Here is the call graph for this function:

◆ EntityInspectorManager() [2/2]

Olympe::EntityInspectorManager::EntityInspectorManager ( const EntityInspectorManager )
privatedelete

Member Function Documentation

◆ FilterByComponent()

std::vector< EntityID > Olympe::EntityInspectorManager::FilterByComponent ( const std::string &  componentType) const

Definition at line 337 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), HasComponent(), and m_EntityList.

+ Here is the call graph for this function:

◆ FilterByName()

std::vector< EntityID > Olympe::EntityInspectorManager::FilterByName ( const std::string &  nameFilter) const

Definition at line 317 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), m_EntityInfoCache, and m_EntityList.

+ Here is the call graph for this function:

◆ ForceSyncWithWorld()

void Olympe::EntityInspectorManager::ForceSyncWithWorld ( )

Definition at line 356 of file EntityInspectorManager.cpp.

References SyncWithWorld().

+ Here is the call graph for this function:

◆ Get()

static EntityInspectorManager & Olympe::EntityInspectorManager::Get ( )
inlinestatic

◆ GetAllEntities()

std::vector< EntityID > Olympe::EntityInspectorManager::GetAllEntities ( ) const

Definition at line 142 of file EntityInspectorManager.cpp.

References m_EntityList.

◆ GetAllEntityInfo()

std::vector< EntityInfo > Olympe::EntityInspectorManager::GetAllEntityInfo ( ) const

Definition at line 147 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), m_EntityInfoCache, and m_EntityList.

Referenced by Olympe::EntitiesPanel::RenderEntityList().

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

◆ GetComponentName()

std::string Olympe::EntityInspectorManager::GetComponentName ( ComponentTypeID  typeId) const
private

Definition at line 416 of file EntityInspectorManager.cpp.

◆ GetComponentProperties()

std::vector< ComponentPropertyInfo > Olympe::EntityInspectorManager::GetComponentProperties ( EntityID  entity,
const std::string &  componentType 
)

Definition at line 188 of file EntityInspectorManager.cpp.

References World::Get(), World::GetComponent(), GetComponentTypeID_Static(), World::HasComponent(), World::IsEntityValid(), and Olympe::ComponentPropertyInfo::name.

Referenced by Olympe::InspectorPanel::RenderComponentProperties().

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

◆ GetComponentTypeId()

ComponentTypeID Olympe::EntityInspectorManager::GetComponentTypeId ( const std::string &  name) const
private

Definition at line 423 of file EntityInspectorManager.cpp.

◆ GetEntityComponents()

std::vector< std::string > Olympe::EntityInspectorManager::GetEntityComponents ( EntityID  entity) const

Definition at line 173 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), and m_EntityInfoCache.

Referenced by HasComponent(), Olympe::InspectorPanel::RenderEntityInspector(), and Olympe::EntitiesPanel::RenderEntityItem().

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

◆ GetEntityCount()

size_t Olympe::EntityInspectorManager::GetEntityCount ( ) const
inline

Definition at line 90 of file EntityInspectorManager.h.

References m_EntityList.

Referenced by Olympe::EntitiesPanel::Render().

+ Here is the caller graph for this function:

◆ GetEntityInfo()

EntityInfo Olympe::EntityInspectorManager::GetEntityInfo ( EntityID  entity) const

Definition at line 159 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), and m_EntityInfoCache.

Referenced by Olympe::NodeGraphPanel::Render(), and Olympe::InspectorPanel::RenderEntityInspector().

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

◆ GetSelectedEntity()

EntityID Olympe::EntityInspectorManager::GetSelectedEntity ( ) const
inline

Definition at line 85 of file EntityInspectorManager.h.

References m_SelectedEntity.

◆ HasComponent()

bool Olympe::EntityInspectorManager::HasComponent ( EntityID  entity,
const std::string &  componentType 
) const

Definition at line 182 of file EntityInspectorManager.cpp.

References GetEntityComponents().

Referenced by FilterByComponent().

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

◆ HasSelection()

bool Olympe::EntityInspectorManager::HasSelection ( ) const
inline

Definition at line 86 of file EntityInspectorManager.h.

References INVALID_ENTITY_ID, and m_SelectedEntity.

◆ Initialize()

void Olympe::EntityInspectorManager::Initialize ( )

Definition at line 28 of file EntityInspectorManager.cpp.

References m_EntityList, m_Initialized, and SyncWithWorld().

Referenced by Olympe::BlueprintEditor::Initialize().

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

◆ Instance()

EntityInspectorManager & Olympe::EntityInspectorManager::Instance ( )
static

Definition at line 13 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static().

Referenced by Get().

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

◆ IsEntityValid()

bool Olympe::EntityInspectorManager::IsEntityValid ( EntityID  entity) const

Definition at line 168 of file EntityInspectorManager.cpp.

References m_EntityList.

Referenced by SetSelectedEntity().

+ Here is the caller graph for this function:

◆ IsInitialized()

bool Olympe::EntityInspectorManager::IsInitialized ( ) const
inline

Definition at line 89 of file EntityInspectorManager.h.

References m_Initialized.

◆ OnComponentAdded()

void Olympe::EntityInspectorManager::OnComponentAdded ( EntityID  entity,
const std::string &  componentType 
)

Definition at line 109 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), m_EntityInfoCache, and m_Initialized.

+ Here is the call graph for this function:

◆ OnComponentRemoved()

void Olympe::EntityInspectorManager::OnComponentRemoved ( EntityID  entity,
const std::string &  componentType 
)

Definition at line 125 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), m_EntityInfoCache, and m_Initialized.

+ Here is the call graph for this function:

◆ OnEntityCreated()

void Olympe::EntityInspectorManager::OnEntityCreated ( EntityID  entity)

Definition at line 65 of file EntityInspectorManager.cpp.

References World::Get(), World::GetComponent(), GetComponentTypeID_Static(), m_EntityInfoCache, m_EntityList, m_Initialized, and Identity_data::name.

Referenced by NotifyEditorEntityCreated(), and SyncWithWorld().

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

◆ OnEntityDestroyed()

void Olympe::EntityInspectorManager::OnEntityDestroyed ( EntityID  entity)

Definition at line 91 of file EntityInspectorManager.cpp.

References GetComponentTypeID_Static(), INVALID_ENTITY_ID, m_EntityInfoCache, m_EntityList, m_Initialized, and m_SelectedEntity.

Referenced by NotifyEditorEntityDestroyed().

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

◆ operator=()

EntityInspectorManager & Olympe::EntityInspectorManager::operator= ( const EntityInspectorManager )
privatedelete

◆ SetComponentProperty()

bool Olympe::EntityInspectorManager::SetComponentProperty ( EntityID  entity,
const std::string &  componentType,
const std::string &  propertyName,
const std::string &  value 
)

Definition at line 254 of file EntityInspectorManager.cpp.

References World::Get(), World::GetComponent(), GetComponentTypeID_Static(), World::HasComponent(), and World::IsEntityValid().

Referenced by Olympe::InspectorPanel::RenderComponentProperties().

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

◆ SetSelectedEntity()

void Olympe::EntityInspectorManager::SetSelectedEntity ( EntityID  entity)

Definition at line 350 of file EntityInspectorManager.cpp.

References INVALID_ENTITY_ID, IsEntityValid(), and m_SelectedEntity.

+ Here is the call graph for this function:

◆ Shutdown()

void Olympe::EntityInspectorManager::Shutdown ( )

Definition at line 42 of file EntityInspectorManager.cpp.

References INVALID_ENTITY_ID, m_EntityInfoCache, m_EntityList, m_Initialized, and m_SelectedEntity.

Referenced by Olympe::BlueprintEditor::Shutdown(), and ~EntityInspectorManager().

+ Here is the caller graph for this function:

◆ SyncWithWorld()

void Olympe::EntityInspectorManager::SyncWithWorld ( )
private

Definition at line 361 of file EntityInspectorManager.cpp.

References World::Get(), GetComponentTypeID_Static(), m_EntityInfoCache, m_EntityList, World::m_entitySignatures, and OnEntityCreated().

Referenced by ForceSyncWithWorld(), and Initialize().

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

◆ Update()

void Olympe::EntityInspectorManager::Update ( )

Definition at line 56 of file EntityInspectorManager.cpp.

References m_Initialized.

Referenced by Olympe::BlueprintEditor::Update().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_EntityInfoCache

std::map<EntityID, EntityInfo> Olympe::EntityInspectorManager::m_EntityInfoCache
private

◆ m_EntityList

std::vector<EntityID> Olympe::EntityInspectorManager::m_EntityList
private

◆ m_Initialized

bool Olympe::EntityInspectorManager::m_Initialized = false
private

◆ m_SelectedEntity

EntityID Olympe::EntityInspectorManager::m_SelectedEntity = INVALID_ENTITY_ID
private

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