diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 15:55:50 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 16:22:16 +0100 |
commit | 73abf154e82546256f4a860c666f1f652767bda9 (patch) | |
tree | 8dda30884e3c8da99f1ea7ebc9232890eeab8bcc /src | |
parent | 23eae734c5e8a49c02e48fe0b401d610abfee9c8 (diff) |
aa
Diffstat (limited to 'src')
-rw-r--r-- | src/world.cpp | 6 | ||||
-rw-r--r-- | src/world.hpp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/world.cpp b/src/world.cpp index 37b78616..f5c378cd 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -105,4 +105,10 @@ void world::do_kill_entity(std::uint64_t id) fm_debug_assert(cnt > 0); } +std::shared_ptr<entity> world::find_entity(std::uint64_t id) +{ + auto it = _entities.find(id); + return it == _entities.end() ? nullptr : it->second.lock(); +} + } // namespace floormat diff --git a/src/world.hpp b/src/world.hpp index dfd7a71a..039f3387 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -77,6 +77,7 @@ public: return ret; } + std::shared_ptr<entity> find_entity(std::uint64_t id); bool is_teardown() const { return _teardown; } fm_DECLARE_DEPRECATED_COPY_ASSIGNMENT(world); |