restructure project
This commit is contained in:
43
include/server/game/ServerGame.h
Normal file
43
include/server/game/ServerGame.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "td/game/BaseGame.h"
|
||||
#include "td/misc/Time.h"
|
||||
#include "ServerWorld.h"
|
||||
|
||||
namespace td {
|
||||
namespace server {
|
||||
|
||||
class Server;
|
||||
|
||||
class ServerGame : public game::Game, public game::GameListener {
|
||||
private:
|
||||
Server* m_Server;
|
||||
ServerWorld m_ServerWorld;
|
||||
utils::AutoTimer m_GoldMineTimer;
|
||||
utils::AutoTimer m_MobStatesTimer;
|
||||
utils::CooldownTimer m_EndGameCooldown;
|
||||
public:
|
||||
ServerGame(Server* server);
|
||||
~ServerGame() {}
|
||||
|
||||
ServerWorld* GetServerWorld() { return &m_ServerWorld; }
|
||||
|
||||
virtual void Tick(std::uint64_t delta);
|
||||
void StartGame();
|
||||
|
||||
// GameListener
|
||||
|
||||
virtual void OnGameStateUpdate(game::GameState newState) override;
|
||||
virtual void OnGameBegin() override;
|
||||
virtual void OnGameEnd() override;
|
||||
virtual void OnGameClose() override;
|
||||
private:
|
||||
void BalanceTeams();
|
||||
void InitPlayerStats();
|
||||
void UpdateMobStates();
|
||||
void UpdateGoldMines();
|
||||
void UpdatePlayerStats();
|
||||
};
|
||||
|
||||
} // namespace game
|
||||
} // namespace td
|
||||
Reference in New Issue
Block a user