Better handling of filling empty slots.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class BattleSide : public ScriptSource {
|
||||
uint8_t _index;
|
||||
uint8_t _creaturesPerSide;
|
||||
std::vector<Creature*> _creatures;
|
||||
std::vector<BaseTurnChoice*> _choices;
|
||||
@@ -15,8 +16,8 @@ namespace CreatureLib::Battling {
|
||||
Battle* _battle;
|
||||
|
||||
public:
|
||||
explicit BattleSide(Battle* battle, uint8_t creaturesPerSide)
|
||||
: _creaturesPerSide(creaturesPerSide), _battle(battle) {
|
||||
explicit BattleSide(uint8_t index, Battle* battle, uint8_t creaturesPerSide)
|
||||
: _index(index), _creaturesPerSide(creaturesPerSide), _battle(battle) {
|
||||
_creatures = std::vector<Creature*>(creaturesPerSide);
|
||||
_choices = std::vector<BaseTurnChoice*>(creaturesPerSide);
|
||||
for (size_t i = 0; i < creaturesPerSide; i++) {
|
||||
@@ -31,6 +32,8 @@ namespace CreatureLib::Battling {
|
||||
[[nodiscard]] bool AllChoicesSet() const;
|
||||
[[nodiscard]] const std::vector<BaseTurnChoice*>& GetChoices() const;
|
||||
|
||||
[[nodiscard]] bool AllPossibleSlotsFilled() const;
|
||||
|
||||
void SetChoice(BaseTurnChoice* choice);
|
||||
void ResetChoices();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user