From 73abf154e82546256f4a860c666f1f652767bda9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 15 Mar 2023 15:55:50 +0100 Subject: aa --- src/world.cpp | 6 ++++++ src/world.hpp | 1 + 2 files changed, 7 insertions(+) (limited to 'src') 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 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 find_entity(std::uint64_t id); bool is_teardown() const { return _teardown; } fm_DECLARE_DEPRECATED_COPY_ASSIGNMENT(world); -- cgit v1.2.3