diff --git a/SDK/include/NDK/Entity.inl b/SDK/include/NDK/Entity.inl index 4a9d35f27..a9fea8fd4 100644 --- a/SDK/include/NDK/Entity.inl +++ b/SDK/include/NDK/Entity.inl @@ -4,7 +4,6 @@ #include #include -#include #include #include @@ -47,8 +46,8 @@ namespace Ndk inline BaseComponent& Entity::GetComponent(nzUInt32 componentId) { - if (!HasComponent(componentId)) - throw std::runtime_error("Tried to get a non-present component"); + ///DOC: Le component doit être présent + NazaraAssert(HasComponent(componentId), "This component is not part of the entity"); BaseComponent* component = m_components[componentId].get(); NazaraAssert(component, "Invalid component pointer"); @@ -59,7 +58,7 @@ namespace Ndk template ComponentType& Entity::GetComponent() { - ///DOC: Lance une exception si le component n'est pas présent + ///DOC: Le component doit être présent static_assert(std::is_base_of(), "ComponentType is not a component"); nzUInt32 componentId = GetComponentId(); @@ -97,6 +96,7 @@ namespace Ndk inline void Entity::RemoveComponent(nzUInt32 componentId) { + ///DOC: N'a aucun effet si le component n'est pas présent if (HasComponent(componentId)) m_components[componentId].reset(); }