mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-08 22:07:10 +00:00
rename object ID method to match existing
This commit is contained in:
parent
b9e4aa5344
commit
ae4d9c4bcb
@ -41,7 +41,7 @@ namespace dECS {
|
|||||||
using StorageConstructor = std::function<std::unique_ptr<IStorage>()>;
|
using StorageConstructor = std::function<std::unique_ptr<IStorage>()>;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr LWOOBJID Id() const noexcept {
|
constexpr LWOOBJID GetObjectID() const noexcept {
|
||||||
return m_Id;
|
return m_Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,20 +17,20 @@ TEST(ECSTest, IncrementEntityIdsSingleThread) {
|
|||||||
auto w = World{};
|
auto w = World{};
|
||||||
|
|
||||||
auto ea = w.MakeEntity();
|
auto ea = w.MakeEntity();
|
||||||
ASSERT_EQ(ea.Id(), 1);
|
ASSERT_EQ(ea.GetObjectID(), 1);
|
||||||
|
|
||||||
auto eb = w.MakeEntity();
|
auto eb = w.MakeEntity();
|
||||||
ASSERT_EQ(eb.Id(), 2);
|
ASSERT_EQ(eb.GetObjectID(), 2);
|
||||||
|
|
||||||
auto ec = w.MakeEntity();
|
auto ec = w.MakeEntity();
|
||||||
ASSERT_EQ(ec.Id(), 3);
|
ASSERT_EQ(ec.GetObjectID(), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test adding and getting components
|
// Test adding and getting components
|
||||||
TEST(ECSTest, MakeOneEntityAndAddComponents) {
|
TEST(ECSTest, MakeOneEntityAndAddComponents) {
|
||||||
auto w = World{};
|
auto w = World{};
|
||||||
auto e = w.MakeEntity();
|
auto e = w.MakeEntity();
|
||||||
ASSERT_EQ(e.Id(), 1);
|
ASSERT_EQ(e.GetObjectID(), 1);
|
||||||
|
|
||||||
// add component
|
// add component
|
||||||
auto* const testCompPtr = e.AddComponent<TestComponent>();
|
auto* const testCompPtr = e.AddComponent<TestComponent>();
|
||||||
@ -54,7 +54,7 @@ TEST(ECSTest, WorldScope) {
|
|||||||
{
|
{
|
||||||
auto w = World{};
|
auto w = World{};
|
||||||
e.emplace(w.MakeEntity());
|
e.emplace(w.MakeEntity());
|
||||||
ASSERT_EQ(e->Id(), 1);
|
ASSERT_EQ(e->GetObjectID(), 1);
|
||||||
|
|
||||||
// add component within scope
|
// add component within scope
|
||||||
auto* const cPtr = e->AddComponent<TestComponent>();
|
auto* const cPtr = e->AddComponent<TestComponent>();
|
||||||
|
Loading…
Reference in New Issue
Block a user