diff --git a/SDK/include/NDK/Algorithm.hpp b/SDK/include/NDK/Algorithm.hpp index c98e63c6c..7c8de5a31 100644 --- a/SDK/include/NDK/Algorithm.hpp +++ b/SDK/include/NDK/Algorithm.hpp @@ -11,11 +11,16 @@ namespace Ndk { + class BaseComponent; + class BaseSystem; + template ComponentId BuildComponentId(const char (&name)[N]); template constexpr ComponentIndex GetComponentIndex(); template constexpr SystemIndex GetSystemIndex(); template ComponentIndex InitializeComponent(const char (&name)[N]); template SystemIndex InitializeSystem(); + template bool IsComponent(BaseComponent& component); + template bool IsSystem(BaseSystem& system); } #include diff --git a/SDK/include/NDK/Algorithm.inl b/SDK/include/NDK/Algorithm.inl index 2f2586868..8392e0ed6 100644 --- a/SDK/include/NDK/Algorithm.inl +++ b/SDK/include/NDK/Algorithm.inl @@ -3,6 +3,8 @@ // For conditions of distribution and use, see copyright notice in Prerequesites.hpp #include +#include +#include namespace Ndk { @@ -44,4 +46,16 @@ namespace Ndk SystemType::systemIndex = SystemType::RegisterSystem(); return SystemType::systemIndex; } + + template + bool IsComponent(BaseComponent& component) + { + return component.GetIndex() == GetComponentIndex(); + } + + template + bool IsSystem(BaseSystem& system) + { + return system.GetIndex() == GetSystemIndex(); + } }