Update to latest Arbutils.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-12-13 12:15:40 +01:00
parent 2055837980
commit e642f374b9
25 changed files with 69 additions and 120 deletions

View File

@@ -7,7 +7,6 @@ using namespace CreatureLib::Battling;
bool BattleSide::AllChoicesSet() const noexcept { return _choicesSet == _creaturesPerSide; }
bool BattleSide::AllPossibleSlotsFilled() const {
AssertNotNull(_battle)
try {
for (size_t i = 0; i < _creatures.Count(); i++) {
auto c = _creatures[i];
@@ -30,7 +29,7 @@ void BattleSide::ResetChoices() noexcept {
}
void BattleSide::SetChoice(BaseTurnChoice* choice) {
AssertNotNull(choice)
EnsureNotNull(choice)
try {
for (size_t i = 0; i < _creatures.Count(); i++) {
auto& c = _creatures[i];
@@ -60,9 +59,6 @@ void BattleSide::SetCreature(ArbUt::OptionalBorrowedPtr<Creature> creature, uint
}
creature.GetValue()->SetBattleData(_battle, this);
creature.GetValue()->SetOnBattleField(true);
if (_battle == nullptr) {
return;
}
for (auto* side : _battle->GetSides()) {
if (side == this) {
continue;
@@ -91,6 +87,5 @@ size_t BattleSide::ScriptCount() const { return _battle->ScriptCount() + 1; }
uint8_t BattleSide::GetRandomCreatureIndex() {
// TODO: Consider adding parameter to only get index for available creatures.
AssertNotNull(_battle)
return _battle->GetRandom()->Get(_creaturesPerSide);
}