refactor: moved mob functions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user