Rework EnTT integration
- Update EnTT to 3.11.1 - Moved EnTT wrapper to EnTTWorld, inheriting EntityWorld - AppEntitySystemComponent can now handles multiple EntityWorld - Headers relying on EnTT are now automatically included if NAZARA_ENTT is defined - Renamed SystemGraph to EnttSystemGraph (as it depends on it for now)
This commit is contained in:
committed by
Jérôme Leclercq
parent
d5f281a768
commit
97fa4d98be
@@ -7,37 +7,10 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline AppEntitySystemComponent::AppEntitySystemComponent(ApplicationBase& app) :
|
||||
ApplicationComponent(app),
|
||||
m_systemGraph(m_registry)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename T, typename... Args>
|
||||
T& AppEntitySystemComponent::AddSystem(Args&&... args)
|
||||
T& AppEntitySystemComponent::AddWorld(Args&&... args)
|
||||
{
|
||||
return m_systemGraph.AddSystem<T>(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
inline entt::handle AppEntitySystemComponent::CreateEntity()
|
||||
{
|
||||
return entt::handle(m_registry, m_registry.create());
|
||||
}
|
||||
|
||||
inline entt::registry& AppEntitySystemComponent::GetRegistry()
|
||||
{
|
||||
return m_registry;
|
||||
}
|
||||
|
||||
inline const entt::registry& AppEntitySystemComponent::GetRegistry() const
|
||||
{
|
||||
return m_registry;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T& AppEntitySystemComponent::GetSystem() const
|
||||
{
|
||||
return m_systemGraph.GetSystem<T>();
|
||||
return static_cast<T&>(*m_worlds.emplace_back(std::make_unique<T>(std::forward<Args>(args)...)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user