#pragma once

#include "game/BaseGame.h"
#include "misc/Time.h"
#include "ServerWorld.h"

namespace td {
namespace server {

class Server;

class ServerGame : public game::Game {
private:
    Server* m_Server;
    ServerWorld m_ServerWorld;
    utils::AutoTimer m_GoldMineTimer{ 1000, std::bind(&ServerGame::updateGoldMines, this) };
public:
    ServerGame(Server* server);
    ~ServerGame() {}

    ServerWorld* getServerWorld() { return &m_ServerWorld; }

    virtual void tick(std::uint64_t delta);
    void startGame();
private:
    void balanceTeams();
    void updateGoldMines();
    void updatePlayerStats();
};

} // namespace game
} // namespace td
