Implemented and fixed all code required to run at least a single turn.
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:
@@ -5,12 +5,14 @@
|
||||
#include "../Flow/ChoiceQueue.hpp"
|
||||
#include "../Library/BattleLibrary.hpp"
|
||||
#include "../TurnChoices/BaseTurnChoice.hpp"
|
||||
#include "BattleParty.hpp"
|
||||
#include "BattleSide.hpp"
|
||||
#include "CreatureIndex.hpp"
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class Battle : public ScriptSource {
|
||||
const BattleLibrary* _library;
|
||||
std::vector<BattleParty> _parties;
|
||||
uint8_t _numberOfSides;
|
||||
uint8_t _creaturesPerSide;
|
||||
std::vector<BattleSide*> _sides;
|
||||
@@ -21,6 +23,21 @@ namespace CreatureLib::Battling {
|
||||
ScriptSet _volatile;
|
||||
|
||||
public:
|
||||
Battle(const BattleLibrary* library, std::vector<BattleParty> parties, uint8_t numberOfSides = 2,
|
||||
uint8_t creaturesPerSide = 1)
|
||||
: _library(library), _parties(parties), _numberOfSides(numberOfSides), _creaturesPerSide(creaturesPerSide) {
|
||||
_sides = std::vector<BattleSide*>(numberOfSides);
|
||||
for (size_t i = 0; i < numberOfSides; i++) {
|
||||
_sides[i] = new BattleSide(this, creaturesPerSide);
|
||||
}
|
||||
}
|
||||
|
||||
~Battle() {
|
||||
for (auto s : _sides) {
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] const BattleLibrary* GetLibrary() const;
|
||||
|
||||
virtual bool CanUse(const BaseTurnChoice* choice);
|
||||
@@ -40,8 +57,8 @@ namespace CreatureLib::Battling {
|
||||
[[nodiscard]] bool HasRecalledSlots() const;
|
||||
|
||||
void ForceRecall(uint8_t side, uint8_t index);
|
||||
|
||||
void FillRecall(uint8_t side, uint8_t, Creature* c);
|
||||
void SwitchCreature(uint8_t side, uint8_t index, Creature* c);
|
||||
|
||||
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user