2019-10-17 12:33:25 +00:00
|
|
|
#ifndef CREATURELIB_BATTLESIDE_HPP
|
|
|
|
#define CREATURELIB_BATTLESIDE_HPP
|
|
|
|
|
|
|
|
#include <vector>
|
2019-10-29 10:19:25 +00:00
|
|
|
#include "../TurnChoices/BaseTurnChoice.hpp"
|
2019-11-28 11:55:22 +00:00
|
|
|
#include "Creature.hpp"
|
2019-10-17 12:33:25 +00:00
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
namespace CreatureLib::Battling {
|
|
|
|
class BattleSide : public ScriptSource {
|
2019-10-29 10:19:25 +00:00
|
|
|
uint8_t _creaturesPerSide;
|
2019-10-24 11:37:55 +00:00
|
|
|
std::vector<Creature*> _creatures;
|
2019-11-10 16:08:42 +00:00
|
|
|
std::vector<BaseTurnChoice*> _choices;
|
2019-11-06 17:08:21 +00:00
|
|
|
uint8_t _choicesSet = 0;
|
2019-11-10 13:32:05 +00:00
|
|
|
ScriptSet _volatile;
|
|
|
|
Battle* _battle;
|
2019-11-28 11:55:22 +00:00
|
|
|
|
2019-10-29 10:19:25 +00:00
|
|
|
public:
|
2019-11-10 13:32:05 +00:00
|
|
|
explicit BattleSide(Battle* battle, uint8_t creaturesPerSide)
|
2019-11-28 11:55:22 +00:00
|
|
|
: _creaturesPerSide(creaturesPerSide), _creatures(creaturesPerSide), _choices(creaturesPerSide),
|
|
|
|
_battle(battle) {
|
2019-10-29 10:19:25 +00:00
|
|
|
ResetChoices();
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]] bool AllChoicesSet() const;
|
2019-11-10 16:08:42 +00:00
|
|
|
[[nodiscard]] const std::vector<BaseTurnChoice*>& GetChoices() const;
|
2019-10-29 10:19:25 +00:00
|
|
|
|
2019-11-10 16:08:42 +00:00
|
|
|
void SetChoice(BaseTurnChoice* choice);
|
2019-10-29 10:19:25 +00:00
|
|
|
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;
|
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override;
|
2019-10-17 12:33:25 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
#endif // CREATURELIB_BATTLESIDE_HPP
|