Fully handle turn ordering
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:
@@ -3,6 +3,7 @@
|
||||
#include "../TurnChoices/AttackTurnChoice.hpp"
|
||||
#include "../Flow/TurnOrdering.hpp"
|
||||
|
||||
using namespace CreatureLib;
|
||||
using namespace CreatureLib::Battling;
|
||||
|
||||
const BattleLibrary *Battle::GetLibrary() const {
|
||||
@@ -39,7 +40,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
TurnOrdering::OrderChoices(choices);
|
||||
TurnOrdering::OrderChoices(choices, _random);
|
||||
auto choiceQueue = ChoiceQueue(choices);
|
||||
this->_currentTurnQueue = &choiceQueue;
|
||||
TurnHandler::RunTurn(choiceQueue);
|
||||
@@ -49,3 +50,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
ChoiceQueue* Battle::GetCurrentTurnQueue() const {
|
||||
return _currentTurnQueue;
|
||||
}
|
||||
|
||||
Core::Random &Battle::GetRandom(){
|
||||
return _random;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace CreatureLib::Battling {
|
||||
uint8_t _numberOfSides;
|
||||
uint8_t _creaturesPerSide;
|
||||
std::vector<BattleSide*> _sides;
|
||||
Core::Random _random;
|
||||
|
||||
ChoiceQueue* _currentTurnQueue = nullptr;
|
||||
public:
|
||||
@@ -24,6 +25,7 @@ namespace CreatureLib::Battling {
|
||||
void CheckChoicesSetAndRun();
|
||||
|
||||
ChoiceQueue* GetCurrentTurnQueue() const;
|
||||
Core::Random& GetRandom();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user