Support for cloning battles for AI purposes.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-04-11 15:20:50 +02:00
parent a3b7002cd4
commit 84a14cff2b
19 changed files with 236 additions and 30 deletions

View File

@@ -63,6 +63,18 @@ namespace CreatureLib::Battling {
}
}
}
virtual CreatureParty* Clone() {
auto party = new CreatureParty(_party.Count());
auto i = 0;
for (auto c : _party) {
if (c != nullptr) {
party->SwapInto(i, c->Clone());
i++;
}
}
return party;
}
};
}