refactor: moved mob functions

This commit is contained in:
2021-12-11 19:30:31 +01:00
parent 6b5c56b37d
commit 0af4cd506c
8 changed files with 219 additions and 182 deletions

View File

@@ -17,5 +17,21 @@ void Game::tick(std::uint64_t delta) {
}
}
Player* Game::getPlayerById(PlayerID id) {
auto it = m_Players.find(id);
if (it == m_Players.end()) return nullptr;
return &it->second;
}
const Player* Game::getPlayerById(PlayerID id) const {
auto it = m_Players.find(id);
if (it == m_Players.end()) return nullptr;
return &it->second;
}
} // namespace game
} // namespace td