From 4f77d30a7d9a993ec5c86b3b59295181a8f606bf Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 26 Mar 2022 11:32:55 +0100 Subject: [PATCH] Adds getter for checking if a slot is unfillable --- src/Battling/Models/BattleSide.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Battling/Models/BattleSide.hpp b/src/Battling/Models/BattleSide.hpp index 7543719..4f8b551 100644 --- a/src/Battling/Models/BattleSide.hpp +++ b/src/Battling/Models/BattleSide.hpp @@ -78,6 +78,16 @@ namespace CreatureLib::Battling { } } + inline bool IsSlotUnfillabe(const ArbUt::BorrowedPtr& creature) const noexcept { + for (u8 i = 0; i < _creaturesPerSide; i++) { + if (!_creatures[i].HasValue()) + continue; + if (_creatures[i].GetValue() == creature) { + return _fillableSlots.At(i) l + } + } + } + bool IsDefeated() noexcept { for (auto b : _fillableSlots) { if (b)