From 0fe3eb62dbbbb08b5cccf21f37762a93c0529dad Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Sun, 15 Mar 2026 00:30:24 +0100 Subject: [PATCH] Append "Component" to component functions --- entitysystem/ecs.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/entitysystem/ecs.h b/entitysystem/ecs.h index 444666a8..76f15e7f 100644 --- a/entitysystem/ecs.h +++ b/entitysystem/ecs.h @@ -78,7 +78,7 @@ class ECS final /// Entity to which component will be added /// Arguments forwarded to component constructor /// Reference to added component - template T &Add(entt::entity entity, Args &&...args) + template T &AddComponent(entt::entity entity, Args &&...args) { return world_.emplace(entity, std::forward(args)...); } @@ -89,7 +89,7 @@ class ECS final /// type /// Entity to which component will be added /// Reference to added component - template T &Get(entt::entity entity) + template T &GetComponent(entt::entity entity) { return world_.get(entity); } @@ -100,7 +100,7 @@ class ECS final /// type /// Entity to which component will be added /// Reference to added component - template const T &Get(entt::entity entity) const + template const T &GetComponent(entt::entity entity) const { return world_.get(entity); } @@ -111,7 +111,7 @@ class ECS final /// Component type /// Entity from which component will be retrieved /// Pointer to component if exists, nullptr otherwise - template T *TryGet(entt::entity entity) + template T *TryGetComponent(entt::entity entity) { return world_.try_get(entity); } @@ -122,7 +122,7 @@ class ECS final /// Component type /// Entity from which component will be retrieved /// Pointer to component if exists, nullptr otherwise - template const T *TryGet(entt::entity entity) const + template const T *TryGetComponent(entt::entity entity) const { return world_.try_get(entity); } @@ -133,7 +133,7 @@ class ECS final /// Component type /// Entity to check /// true if entity has component, false otherwise - template bool Has(entt::entity entity) const + template bool HasComponent(entt::entity entity) const { return world_.all_of(entity); } @@ -142,7 +142,7 @@ class ECS final /// Removes component of type T from entity. Does nothing if component does not exist. /// Component type /// Entity from which component will be removed - template void Remove(entt::entity entity) + template void RemoveComponent(entt::entity entity) { world_.remove(entity); }