Ndk/Algorithm: Fixed headers cyclic dependency

Former-commit-id: a6d4d21586ef948dd68f1d3e7dc01e8275aaac3f
This commit is contained in:
Lynix 2015-05-03 19:48:33 +02:00
parent 31227ca567
commit 9bffaaaa84
2 changed files with 6 additions and 11 deletions

View File

@ -11,16 +11,13 @@
namespace Ndk namespace Ndk
{ {
class BaseComponent;
class BaseSystem;
template<unsigned int N> ComponentId BuildComponentId(const char (&name)[N]); template<unsigned int N> ComponentId BuildComponentId(const char (&name)[N]);
template<typename ComponentType> constexpr ComponentIndex GetComponentIndex(); template<typename ComponentType> constexpr ComponentIndex GetComponentIndex();
template<typename SystemType> constexpr SystemIndex GetSystemIndex(); template<typename SystemType> constexpr SystemIndex GetSystemIndex();
template<typename ComponentType, unsigned int N> ComponentIndex InitializeComponent(const char (&name)[N]); template<typename ComponentType, unsigned int N> ComponentIndex InitializeComponent(const char (&name)[N]);
template<typename SystemType> SystemIndex InitializeSystem(); template<typename SystemType> SystemIndex InitializeSystem();
template<typename ComponentType> bool IsComponent(BaseComponent& component); template<typename ComponentType, typename C> bool IsComponent(C& component);
template<typename SystemType> bool IsSystem(BaseSystem& system); template<typename SystemType, typename S> bool IsSystem(S& system);
} }
#include <Ndk/Algorithm.inl> #include <Ndk/Algorithm.inl>

View File

@ -3,8 +3,6 @@
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp // For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#include <Nazara/Core/Endianness.hpp> #include <Nazara/Core/Endianness.hpp>
#include <Ndk/BaseComponent.hpp>
#include <Ndk/BaseSystem.hpp>
namespace Ndk namespace Ndk
{ {
@ -47,14 +45,14 @@ namespace Ndk
return SystemType::systemIndex; return SystemType::systemIndex;
} }
template<typename ComponentType> template<typename ComponentType, typename C>
bool IsComponent(BaseComponent& component) bool IsComponent(C& component)
{ {
return component.GetIndex() == GetComponentIndex<ComponentType>(); return component.GetIndex() == GetComponentIndex<ComponentType>();
} }
template<typename SystemType> template<typename SystemType, typename S>
bool IsSystem(BaseSystem& system) bool IsSystem(S& system)
{ {
return system.GetIndex() == GetSystemIndex<SystemType>(); return system.GetIndex() == GetSystemIndex<SystemType>();
} }