CardUtil: getLKICopy should not update the View

This commit is contained in:
Hanmac
2017-02-05 10:11:33 +00:00
parent 83c05e35a5
commit 603b803b04
2 changed files with 10 additions and 5 deletions

View File

@@ -608,7 +608,13 @@ public class CardFactory {
* @param toState
* the {@link CardStateName} of {@code to} to copy to.
*/
public static void copyState(final Card from, final CardStateName fromState, final Card to, final CardStateName toState) {
public static void copyState(final Card from, final CardStateName fromState, final Card to,
final CardStateName toState) {
copyState(from, fromState, to, toState, true);
}
public static void copyState(final Card from, final CardStateName fromState, final Card to,
final CardStateName toState, boolean updateView) {
// copy characteristics not associated with a state
to.setBaseLoyalty(from.getBaseLoyalty());
to.setBasePowerString(from.getBasePowerString());
@@ -617,10 +623,9 @@ public class CardFactory {
// get CardCharacteristics for desired state
if (!to.getStates().contains(toState)) {
to.addAlternateState(toState, true);
to.addAlternateState(toState, updateView);
}
final CardState toCharacteristics = to.getState(toState),
fromCharacteristics = from.getState(fromState);
final CardState toCharacteristics = to.getState(toState), fromCharacteristics = from.getState(fromState);
toCharacteristics.copyFrom(from, fromCharacteristics);
}

View File

@@ -275,7 +275,7 @@ public final class CardUtil {
// don't just copy the current state. copy all of them
// needed for Transformed to get the CMC correct
for (final CardStateName state : in.getStates()) {
CardFactory.copyState(in, state, newCopy, state);
CardFactory.copyState(in, state, newCopy, state, false);
}
// DO NOT UPDATE THE VIEW!
newCopy.setState(in.getCurrentStateName(), false);