GUI: improved double faced tokens:

- added tokens support in test render dialog;
 - improved PT drawing;
 - fixed broken second side switch button (related to #10231);
 - fixed miss override in TokenImpl (all override with backFace must be removed, see todo);
This commit is contained in:
Oleg Agafonov 2023-04-29 19:13:13 +04:00
parent 8cb89a9a98
commit 583c5fe4e9
13 changed files with 270 additions and 140 deletions

View file

@ -22,6 +22,7 @@ import mage.constants.ColoredManaSymbol;
import mage.constants.ManaType;
import mage.filter.FilterMana;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.players.Player;
import java.util.*;
@ -638,6 +639,10 @@ public final class ManaUtil {
return getColorIdentity(card.getColor(), String.join("", card.getManaCostSymbols()), card.getRules(), secondSide);
}
public static FilterMana getColorIdentity(Token token) {
return getColorIdentity(token.getColor(), String.join("", token.getManaCostSymbols()), token.getAbilities().getRules(token.getName()), null);
}
public static int getColorIdentityHash(FilterMana colorIdentity) {
int hash = 3;
hash = 23 * hash + (colorIdentity.isWhite() ? 1 : 0);