Adds function on battleside to get a creature at an index.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-08-23 21:38:47 +02:00
parent 9a72c1051e
commit d89e0b0d77
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 3 additions and 1 deletions

View File

@ -50,6 +50,8 @@ namespace CreatureLib::Battling {
const ArbUt::List<ArbUt::OptionalBorrowedPtr<Creature>>& GetCreatures() { return _creatures; }
const ArbUt::OptionalBorrowedPtr<Creature>& GetCreature(u8 index) { return _creatures[index]; }
uint8_t GetSideIndex() noexcept { return _index; }
uint8_t GetCreatureIndex(const ArbUt::BorrowedPtr<Creature>& 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> battle) const;
BattleSide* CloneWithoutCreatures(ArbUt::BorrowedPtr<Battle> battle) const;
};
}