restructure project

This commit is contained in:
2023-08-13 11:59:13 +02:00
parent b4836847f5
commit 50c17e8ed1
210 changed files with 471 additions and 422 deletions

37
src/td/game/BaseGame.cpp Normal file
View File

@@ -0,0 +1,37 @@
#include "td/game/BaseGame.h"
namespace td {
namespace game {
Game::Game(World* world) : m_World(world) {
}
Game::~Game() {
}
void Game::Tick(std::uint64_t delta) {
if (m_GameState == GameState::Game) {
m_World->Tick(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