From ae4d9c4bcbb321cc4115938dcaf6789ad8572516 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 17 Dec 2024 00:57:25 -0600 Subject: [PATCH] rename object ID method to match existing --- dECS/Core.h | 2 +- tests/dECSTests/TestECS.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dECS/Core.h b/dECS/Core.h index 1b3127a8..200cb2ad 100644 --- a/dECS/Core.h +++ b/dECS/Core.h @@ -41,7 +41,7 @@ namespace dECS { using StorageConstructor = std::function()>; [[nodiscard]] - constexpr LWOOBJID Id() const noexcept { + constexpr LWOOBJID GetObjectID() const noexcept { return m_Id; } diff --git a/tests/dECSTests/TestECS.cpp b/tests/dECSTests/TestECS.cpp index 0bceacbd..33041dc4 100644 --- a/tests/dECSTests/TestECS.cpp +++ b/tests/dECSTests/TestECS.cpp @@ -17,20 +17,20 @@ TEST(ECSTest, IncrementEntityIdsSingleThread) { auto w = World{}; auto ea = w.MakeEntity(); - ASSERT_EQ(ea.Id(), 1); + ASSERT_EQ(ea.GetObjectID(), 1); auto eb = w.MakeEntity(); - ASSERT_EQ(eb.Id(), 2); + ASSERT_EQ(eb.GetObjectID(), 2); auto ec = w.MakeEntity(); - ASSERT_EQ(ec.Id(), 3); + ASSERT_EQ(ec.GetObjectID(), 3); } // Test adding and getting components TEST(ECSTest, MakeOneEntityAndAddComponents) { auto w = World{}; auto e = w.MakeEntity(); - ASSERT_EQ(e.Id(), 1); + ASSERT_EQ(e.GetObjectID(), 1); // add component auto* const testCompPtr = e.AddComponent(); @@ -54,7 +54,7 @@ TEST(ECSTest, WorldScope) { { auto w = World{}; e.emplace(w.MakeEntity()); - ASSERT_EQ(e->Id(), 1); + ASSERT_EQ(e->GetObjectID(), 1); // add component within scope auto* const cPtr = e->AddComponent();