Skip to content

Commit

Permalink
rename object ID method to match existing
Browse files Browse the repository at this point in the history
  • Loading branch information
jadebenn committed Dec 17, 2024
1 parent b9e4aa5 commit ae4d9c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dECS/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace dECS {
using StorageConstructor = std::function<std::unique_ptr<IStorage>()>;

[[nodiscard]]
constexpr LWOOBJID Id() const noexcept {
constexpr LWOOBJID GetObjectID() const noexcept {
return m_Id;
}

Expand Down
10 changes: 5 additions & 5 deletions tests/dECSTests/TestECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TestComponent>();
Expand All @@ -54,7 +54,7 @@ TEST(ECSTest, WorldScope) {
{
auto w = World{};
e.emplace(w.MakeEntity());

Check failure on line 56 in tests/dECSTests/TestECS.cpp

View workflow job for this annotation

GitHub Actions / Build & Test (windows-2022)

'e': cannot be used before it is initialized [D:\a\DarkflameServer\DarkflameServer\build\msvc\tests\dECSTests\dECSTests.vcxproj]
ASSERT_EQ(e->Id(), 1);
ASSERT_EQ(e->GetObjectID(), 1);

Check failure on line 57 in tests/dECSTests/TestECS.cpp

View workflow job for this annotation

GitHub Actions / Build & Test (windows-2022)

'testing::internal::EqHelper::Compare': function does not take 3 arguments [D:\a\DarkflameServer\DarkflameServer\build\msvc\tests\dECSTests\dECSTests.vcxproj]

// add component within scope
auto* const cPtr = e->AddComponent<TestComponent>();

Check failure on line 60 in tests/dECSTests/TestECS.cpp

View workflow job for this annotation

GitHub Actions / Build & Test (windows-2022)

syntax error: ')' [D:\a\DarkflameServer\DarkflameServer\build\msvc\tests\dECSTests\dECSTests.vcxproj]
Expand Down

0 comments on commit ae4d9c4

Please sign in to comment.