#pragma once #include #include #include "game/Team.h" namespace td { namespace game { class Player { private: game::TeamColor m_TeamColor; std::uint32_t m_Gold; std::uint32_t m_Exp; std::string m_Name; PlayerID m_ID; std::uint8_t m_GoldPerSecond; public: Player(std::uint8_t id = 0) : m_TeamColor(game::TeamColor::None), m_Gold(0), m_Exp(0), m_ID(id), m_GoldPerSecond(5) {} const std::string& GetName() const { return m_Name; } void SetName(const std::string& name) { m_Name = name; } game::TeamColor GetTeamColor() const { return m_TeamColor; } void SetTeamColor(game::TeamColor teamColor) { m_TeamColor = teamColor; } std::uint8_t GetGoldPerSecond() const { return m_GoldPerSecond; } void SetGoldPerSecond(std::uint8_t goldPerSecond) { m_GoldPerSecond = goldPerSecond; } std::uint32_t GetGold() const { return m_Gold; } void SetGold(std::uint32_t gold) { m_Gold = gold; } void AddGold(std::uint32_t gold) { m_Gold += gold; } void RemoveGold(std::uint32_t gold) { m_Gold -= gold; } std::uint32_t GetExp() const { return m_Exp; } void SetExp(std::uint32_t exp) { m_Exp = exp; } void AddExp(std::uint32_t exp) { m_Exp += exp; } void RemoveExp(std::uint32_t exp) { m_Exp -= exp; } PlayerID GetID() const { return m_ID; } }; } // namespace game } // namespace td