refactor: format code
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
namespace td {
|
||||
namespace game {
|
||||
|
||||
enum class GameState : std::uint8_t{
|
||||
enum class GameState : std::uint8_t {
|
||||
Lobby,
|
||||
Game,
|
||||
EndGame,
|
||||
@@ -16,10 +16,10 @@ enum class GameState : std::uint8_t{
|
||||
|
||||
typedef std::map<std::uint8_t, Player> PlayerList;
|
||||
|
||||
class Game{
|
||||
class Game {
|
||||
protected:
|
||||
World* m_World;
|
||||
std::array<Team, 2> m_Teams = {Team{TeamColor::Red}, Team{TeamColor::Blue}};
|
||||
std::array<Team, 2> m_Teams = { Team{TeamColor::Red}, Team{TeamColor::Blue} };
|
||||
GameState m_GameState = GameState::Lobby;
|
||||
PlayerList m_Players;
|
||||
public:
|
||||
@@ -28,23 +28,23 @@ public:
|
||||
|
||||
virtual void tick(std::uint64_t delta);
|
||||
|
||||
Team& getRedTeam(){ return m_Teams[(std::uint8_t)TeamColor::Red]; }
|
||||
const Team& getRedTeam() const{ return m_Teams[(std::uint8_t)TeamColor::Red]; }
|
||||
Team& getRedTeam() { return m_Teams[(std::uint8_t)TeamColor::Red]; }
|
||||
const Team& getRedTeam() const { return m_Teams[(std::uint8_t)TeamColor::Red]; }
|
||||
|
||||
Team& getBlueTeam(){ return m_Teams[(std::uint8_t)TeamColor::Blue]; }
|
||||
const Team& getBlueTeam() const{ return m_Teams[(std::uint8_t)TeamColor::Blue]; }
|
||||
Team& getBlueTeam() { return m_Teams[(std::uint8_t)TeamColor::Blue]; }
|
||||
const Team& getBlueTeam() const { return m_Teams[(std::uint8_t)TeamColor::Blue]; }
|
||||
|
||||
Team& getTeam(TeamColor team){ return m_Teams[(std::uint8_t)team]; }
|
||||
const Team& getTeam(TeamColor team) const{ return m_Teams[(std::uint8_t)team]; }
|
||||
Team& getTeam(TeamColor team) { return m_Teams[(std::uint8_t)team]; }
|
||||
const Team& getTeam(TeamColor team) const { return m_Teams[(std::uint8_t)team]; }
|
||||
|
||||
GameState getGameState() const{ return m_GameState; }
|
||||
void setGameState(GameState gameState){ m_GameState = gameState; };
|
||||
GameState getGameState() const { return m_GameState; }
|
||||
void setGameState(GameState gameState) { m_GameState = gameState; };
|
||||
|
||||
const World* getWorld() const{ return m_World; }
|
||||
World* getWorld(){ return m_World; }
|
||||
const World* getWorld() const { return m_World; }
|
||||
World* getWorld() { return m_World; }
|
||||
|
||||
const PlayerList& getPlayers() const{ return m_Players; }
|
||||
PlayerList& getPlayers(){ return m_Players; }
|
||||
const PlayerList& getPlayers() const { return m_Players; }
|
||||
PlayerList& getPlayers() { return m_Players; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user