CreatureLib/src/Battling/Models/BattleSide.hpp

41 lines
1.2 KiB
C++
Raw Normal View History

2019-10-17 12:33:25 +00:00
#ifndef CREATURELIB_BATTLESIDE_HPP
#define CREATURELIB_BATTLESIDE_HPP
#include <vector>
#include "Creature.hpp"
#include "../TurnChoices/BaseTurnChoice.hpp"
2019-10-17 12:33:25 +00:00
namespace CreatureLib::Battling{
class BattleSide : public ScriptSource{
uint8_t _creaturesPerSide;
std::vector<Creature*> _creatures;
std::vector<BaseTurnChoice*> _choices;
uint8_t _choicesSet = 0;
ScriptSet _volatile;
Battle* _battle;
public:
explicit BattleSide(Battle* battle, uint8_t creaturesPerSide)
: _creaturesPerSide(creaturesPerSide), _creatures(creaturesPerSide), _choices(creaturesPerSide), _battle(battle)
{
ResetChoices();
}
[[nodiscard]] bool AllChoicesSet() const;
[[nodiscard]] const std::vector<BaseTurnChoice*>& GetChoices() const;
void SetChoice(BaseTurnChoice* choice);
void ResetChoices();
void SetCreature(Creature* creature, uint8_t index);
2019-11-02 12:57:43 +00:00
Creature* GetCreature(uint8_t index) const;
bool CreatureOnSide(const Creature* creature) const;
void GetActiveScripts(std::vector<ScriptWrapper> &scripts) override;
2019-10-17 12:33:25 +00:00
};
}
#endif //CREATURELIB_BATTLESIDE_HPP