#ifndef CREATURELIB_BATTLE_HPP #define CREATURELIB_BATTLE_HPP #include #include "BattleSide.hpp" #include "../Library/BattleLibrary.hpp" #include "../TurnChoices/BaseTurnChoice.hpp" #include "../Flow/ChoiceQueue.hpp" #include "Target.hpp" namespace CreatureLib::Battling { class Battle { const BattleLibrary* _library; uint8_t _numberOfSides; uint8_t _creaturesPerSide; std::vector _sides; Core::Random _random; ChoiceQueue* _currentTurnQueue = nullptr; uint8_t _numberOfRecalledSlots = 0; public: [[nodiscard]] const BattleLibrary* GetLibrary() const; virtual bool CanUse(const BaseTurnChoice* choice); virtual bool TrySetChoice(BaseTurnChoice* choice); void CheckChoicesSetAndRun(); [[nodiscard]] ChoiceQueue* GetCurrentTurnQueue() const; Core::Random& GetRandom(); bool CreatureInField(const Creature* creature) const; Creature* GetTarget(const Target& target){ return _sides[target.GetSideIndex()]->GetCreature(target.GetCreatureIndex()); } [[nodiscard]] bool HasRecalledSlots() const; void ForceRecall(uint8_t side, uint8_t index); void FillRecall(uint8_t side, uint8_t, Creature* c); }; } #endif //CREATURELIB_BATTLE_HPP