From d89e0b0d77354e3e624ced5560888c94ed57c7b7 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 23 Aug 2021 21:38:47 +0200 Subject: [PATCH] Adds function on battleside to get a creature at an index. Signed-off-by: Deukhoofd --- src/Battling/Models/BattleSide.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Battling/Models/BattleSide.hpp b/src/Battling/Models/BattleSide.hpp index 164a4a0..0073cec 100644 --- a/src/Battling/Models/BattleSide.hpp +++ b/src/Battling/Models/BattleSide.hpp @@ -50,6 +50,8 @@ namespace CreatureLib::Battling { const ArbUt::List>& GetCreatures() { return _creatures; } + const ArbUt::OptionalBorrowedPtr& GetCreature(u8 index) { return _creatures[index]; } + uint8_t GetSideIndex() noexcept { return _index; } uint8_t GetCreatureIndex(const ArbUt::BorrowedPtr& c) { for (size_t i = 0; i < _creatures.Count(); i++) { @@ -88,7 +90,7 @@ namespace CreatureLib::Battling { bool SwapPositions(u8 a, u8 b); - BattleSide *CloneWithoutCreatures(ArbUt::BorrowedPtr battle) const; + BattleSide* CloneWithoutCreatures(ArbUt::BorrowedPtr battle) const; }; }