50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
#include "game/Team.h"
|
|
#include "game/PlayerUpgrades.h"
|
|
|
|
namespace td {
|
|
namespace game {
|
|
|
|
class Player {
|
|
private:
|
|
game::TeamColor m_TeamColor;
|
|
PlayerUpgrades m_Upgrades;
|
|
|
|
std::uint32_t m_Gold;
|
|
std::uint32_t m_Exp;
|
|
std::string m_Name;
|
|
PlayerID m_ID;
|
|
|
|
public:
|
|
|
|
Player(std::uint8_t id = 0) : m_TeamColor(game::TeamColor::None), m_Gold(0), m_Exp(0), m_ID(id) {}
|
|
|
|
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::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; }
|
|
|
|
const PlayerUpgrades& getUpgrades() const { return m_Upgrades; }
|
|
PlayerUpgrades& getUpgrades() { return m_Upgrades; }
|
|
|
|
PlayerID GetID() const { return m_ID; }
|
|
};
|
|
|
|
} // namespace game
|
|
} // namespace td
|