Core/EnttWorld: Add GetAliveEntityCount method
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Nz
|
||||
|
||||
entt::handle CreateEntity();
|
||||
|
||||
inline std::size_t GetAliveEntityCount() const;
|
||||
entt::registry& GetRegistry();
|
||||
const entt::registry& GetRegistry() const;
|
||||
template<typename T> T& GetSystem() const;
|
||||
|
||||
@@ -22,6 +22,11 @@ namespace Nz
|
||||
return entt::handle(m_registry, m_registry.create());
|
||||
}
|
||||
|
||||
inline std::size_t EnttWorld::GetAliveEntityCount() const
|
||||
{
|
||||
return m_registry.storage<entt::entity>()->in_use();
|
||||
}
|
||||
|
||||
inline entt::registry& EnttWorld::GetRegistry()
|
||||
{
|
||||
return m_registry;
|
||||
|
||||
Reference in New Issue
Block a user