aboutsummaryrefslogtreecommitdiff
path: root/src/client/shared.cc
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
commite4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch)
treeed58c3c246e3af1af337697695d780aa31f6ad9a /src/client/shared.cc
parent1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff)
Update to most recent version (old initial commit)
Diffstat (limited to 'src/client/shared.cc')
-rw-r--r--src/client/shared.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/client/shared.cc b/src/client/shared.cc
index 3c6a2ec..0346e3d 100644
--- a/src/client/shared.cc
+++ b/src/client/shared.cc
@@ -1 +1,18 @@
#include "shared.hh"
+
+namespace client {
+
+entities_t::iterator get_entity_it(const std::uint32_t& index) noexcept {
+ return client::state::entities.find(index);
+}
+
+shared::entity& get_entity(const std::uint32_t index) noexcept {
+ return *get_entity_it(index)->second;
+}
+
+client::player& get_localplayer() noexcept {
+ return dynamic_cast<client::player&>(
+ get_entity(*client::state::localplayer_index));
+}
+
+} // namespace client