mirror of
https://github.com/correl/mage.git
synced 2025-01-12 03:00:13 +00:00
add filter copy to GameState's copy constructor and restore method
This commit is contained in:
parent
1dc305f329
commit
5a1b40a42f
1 changed files with 5 additions and 0 deletions
|
@ -179,6 +179,8 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
this.copiedCards.putAll(state.copiedCards);
|
||||
this.permanentOrderNumber = state.permanentOrderNumber;
|
||||
this.applyEffectsCounter = state.applyEffectsCounter;
|
||||
state.usePowerInsteadOfToughnessForDamageLethalityFilters.forEach((uuid, filter) ->
|
||||
this.usePowerInsteadOfToughnessForDamageLethalityFilters.put(uuid, filter.copy()));
|
||||
}
|
||||
|
||||
public void restoreForRollBack(GameState state) {
|
||||
|
@ -224,6 +226,8 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
this.copiedCards = state.copiedCards;
|
||||
this.permanentOrderNumber = state.permanentOrderNumber;
|
||||
this.applyEffectsCounter = state.applyEffectsCounter;
|
||||
state.usePowerInsteadOfToughnessForDamageLethalityFilters.forEach((uuid, filter) ->
|
||||
this.usePowerInsteadOfToughnessForDamageLethalityFilters.put(uuid, filter.copy()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1097,6 +1101,7 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
zones.clear();
|
||||
simultaneousEvents.clear();
|
||||
copiedCards.clear();
|
||||
usePowerInsteadOfToughnessForDamageLethalityFilters.clear();
|
||||
permanentOrderNumber = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue