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

@@ -123,3 +123,10 @@ bool BattleSide::SwapPositions(u8 a, u8 b) {
_battle->TriggerEventListener<SwapEvent>(_index, a, b);
return true;
}
BattleSide* BattleSide::CloneWithoutCreatures() {
auto* side = new BattleSide(_index, _battle, _creaturesPerSide);
side->_choicesSet = _choicesSet;
_volatile.Clone(side->_volatile);
side->_hasFled = _hasFled;
return side;
}