Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.14 KB | None | 0 0
  1.     class Player
  2.     {
  3.     public:
  4.         using Bag = std::vector<CoinHandle>;
  5.         //                                          // - - -> log message , scale
  6.         using FightLog = std::map<Stage, std::vector<std::pair<std::string, float>>>;
  7.     public:
  8.         constexpr static HealthAmount MaxHealth = 10;
  9.         constexpr static CoinAmount CoinsPerRound = 3;
  10.         constexpr static CoinAmount CoinsInAction = 3;
  11.         constexpr static CoinAmount CoinsInHand = 5;
  12.     public:
  13.         Player(const std::string& name);
  14.     public:
  15.         const std::string& name() const;
  16.     public:
  17.         void initializeRound(); // TODO: move to Fight.h
  18.         void calculate();
  19.  
  20.         bool isAlive() const;
  21.         HealthAmount getHealth() const;
  22.         void takeDefence(DefenceAmount amount);
  23.         AttackAmount attackTaken() const;
  24.         DefenceAmount defenceTaken() const;
  25.         AttackAmount attackGiven() const;
  26.         void takeAttack(AttackAmount amount);
  27.         void recordAttack(AttackAmount amount); // TODO: recordAttack - find better name
  28.         void addStatusEffect(const EffectHandle& effect);
  29.     public:
  30.         HealthAmount getMaxHealth() const;
  31.         CoinAmount getCoinsPerRound();
  32.         CoinAmount getCoinsInHand();
  33.         CoinAmount getCoinsInActionLimit();
  34.     public:
  35.         void discardCoinsInStatusEffect();
  36.         void discardCoinsInAction();
  37.         void blockCoinsBy(CoinAmount amount);
  38.         const CoinHandle& randomCoin() const;
  39.         CoinHandle removeRandomCoinFromBag();
  40.         CoinHandle removeMaxDamageCoin();
  41.         void removeCoin(const CoinHandle& target);
  42.         void fillHand();
  43.     public:
  44.         void moveSelectedCoin();
  45.         CoinHandle selectedCoin() const;
  46.         Hand selectedCoinPlace() const;
  47.         void setSelectedCoin(const CoinHandle& targetCoin);
  48.     public:
  49.         const Coins& getCoinsInStatusEffect();
  50.         const Bag& getBag() const; // TODO: getBag - rename to getDeckCoins()
  51.         const Coins& getHoldCoins() const;
  52.         const Coins& getActionCoins() const;
  53.         CoinAmount countCoinsInBag(const std::string& targetName) const;
  54.         void addCoinToBag(const CoinHandle& newCoin);
  55.         void removeCoinFromBagByName(const std::string& targetName);
  56.         void moveCoinToHand(const CoinHandle& target);
  57.         void moveCoinToAction(const CoinHandle& target);
  58.         void dropToHold(const CoinHandle& target);
  59.         void dropToAction(const CoinHandle& target);
  60.     public:
  61.         void clearFightLog();
  62.         const FightLog& getFightLog() const;
  63.         void appendToFightLog(Stage stage, const std::string& action);
  64.         void appendToFightLog(Stage stage, float scale, const std::string& action);
  65.     private:
  66.         std::string m_name;
  67.         HealthAmount m_health;
  68.         AttackAmount m_attackGet;
  69.         DefenceAmount m_defenceGet;
  70.         AttackAmount m_attackGive;
  71.         CoinAmount m_coinsBlocked;
  72.         Coins m_actionCoins;
  73.         Coins m_holdCoins;
  74.         Coins m_statusEffectCoins;
  75.         CoinHandle m_selectedCoin;
  76.         Hand m_selectedCoinInHand;
  77.         Bag m_bag;
  78.         FightLog m_fightLog;
  79.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement