Used ClangFormat style guide I'm happy with.
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:
@@ -1,47 +1,39 @@
|
||||
#include "BattleSide.hpp"
|
||||
#include "../../Core/Exceptions/CreatureException.hpp"
|
||||
#include <algorithm>
|
||||
#include "../../Core/Exceptions/CreatureException.hpp"
|
||||
#include "Battle.hpp"
|
||||
|
||||
using namespace CreatureLib::Battling;
|
||||
|
||||
bool BattleSide::AllChoicesSet() const {
|
||||
return _choicesSet == _creaturesPerSide;
|
||||
}
|
||||
bool BattleSide::AllChoicesSet() const { return _choicesSet == _creaturesPerSide; }
|
||||
|
||||
void BattleSide::ResetChoices() {
|
||||
_choicesSet = 0;
|
||||
for (uint8_t i = 0; i < _creaturesPerSide; i++){
|
||||
for (uint8_t i = 0; i < _creaturesPerSide; i++) {
|
||||
_choices[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<BaseTurnChoice *>& BattleSide::GetChoices() const{
|
||||
return _choices;
|
||||
}
|
||||
const std::vector<BaseTurnChoice*>& BattleSide::GetChoices() const { return _choices; }
|
||||
|
||||
void BattleSide::SetChoice(BaseTurnChoice *choice) {
|
||||
void BattleSide::SetChoice(BaseTurnChoice* choice) {
|
||||
auto find = std::find(_creatures.begin(), _creatures.end(), choice->GetUser());
|
||||
if (find ==_creatures.end())
|
||||
if (find == _creatures.end())
|
||||
throw CreatureException("User not found");
|
||||
uint8_t index = std::distance(_creatures.begin(),find);
|
||||
uint8_t index = std::distance(_creatures.begin(), find);
|
||||
_choices[index] = choice;
|
||||
_choicesSet++;
|
||||
}
|
||||
|
||||
void BattleSide::SetCreature(Creature *creature, uint8_t index) {
|
||||
_creatures[index] = creature;
|
||||
}
|
||||
void BattleSide::SetCreature(Creature* creature, uint8_t index) { _creatures[index] = creature; }
|
||||
|
||||
bool BattleSide::CreatureOnSide(const Creature *creature) const {
|
||||
bool BattleSide::CreatureOnSide(const Creature* creature) const {
|
||||
return std::find(_creatures.begin(), _creatures.end(), creature) != _creatures.end();
|
||||
}
|
||||
|
||||
Creature *BattleSide::GetCreature(uint8_t index) const {
|
||||
return _creatures[index];
|
||||
}
|
||||
Creature* BattleSide::GetCreature(uint8_t index) const { return _creatures[index]; }
|
||||
|
||||
void BattleSide::GetActiveScripts(std::vector<ScriptWrapper> &scripts) {
|
||||
void BattleSide::GetActiveScripts(std::vector<ScriptWrapper>& scripts) {
|
||||
scripts.emplace_back(&_volatile);
|
||||
_battle->GetActiveScripts(scripts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user