mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
ColorSet: turn Set into an Enum (#8757)
This commit is contained in:
@@ -33,7 +33,7 @@ public class ColorSetRenderer extends ItemCellRenderer {
|
||||
this.cs = (ColorSet) value;
|
||||
}
|
||||
else {
|
||||
this.cs = ColorSet.NO_COLORS;
|
||||
this.cs = ColorSet.C;
|
||||
}
|
||||
this.setToolTipText(cs.toString());
|
||||
return super.getTableCellRendererComponent(table, "", isSelected, hasFocus, row, column);
|
||||
|
||||
@@ -214,22 +214,8 @@ public class VAssignGenericAmount {
|
||||
pnlTargets.add(mp, "w 145px!, h 170px!, gap 5px 5px 3px 3px, ax center");
|
||||
mp.addMouseListener(mad);
|
||||
targetsMap.put(mp, at);
|
||||
} else if (at.entity instanceof Byte) {
|
||||
SkinImage manaSymbol;
|
||||
byte color = (Byte) at.entity;
|
||||
if (color == MagicColor.WHITE) {
|
||||
manaSymbol = FSkin.getImage(FSkinProp.IMG_MANA_W);
|
||||
} else if (color == MagicColor.BLUE) {
|
||||
manaSymbol = FSkin.getImage(FSkinProp.IMG_MANA_U);
|
||||
} else if (color == MagicColor.BLACK) {
|
||||
manaSymbol = FSkin.getImage(FSkinProp.IMG_MANA_B);
|
||||
} else if (color == MagicColor.RED) {
|
||||
manaSymbol = FSkin.getImage(FSkinProp.IMG_MANA_R);
|
||||
} else if (color == MagicColor.GREEN) {
|
||||
manaSymbol = FSkin.getImage(FSkinProp.IMG_MANA_G);
|
||||
} else { // Should never come here, but add this to avoid compile error
|
||||
manaSymbol = FSkin.getImage(FSkinProp.IMG_MANA_COLORLESS);
|
||||
}
|
||||
} else if (at.entity instanceof MagicColor.Color color) {
|
||||
SkinImage manaSymbol = FSkin.getImage(FSkinProp.MANA_IMG.get(color.getShortName()));
|
||||
final MiscCardPanel mp = new MiscCardPanel(matchUI, "", manaSymbol);
|
||||
mp.setCardBounds(0, 0, 70, 70);
|
||||
pnlTargets.add(mp, "w 100px!, h 150px!, gap 5px 5px 3px 3px, ax center");
|
||||
|
||||
@@ -471,12 +471,12 @@ public class PlayerControllerForTests extends PlayerController {
|
||||
|
||||
@Override
|
||||
public byte chooseColor(String message, SpellAbility sa, ColorSet colors) {
|
||||
return Iterables.getFirst(colors, MagicColor.WHITE);
|
||||
return Iterables.getFirst(colors, MagicColor.Color.WHITE).getColorMask();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte chooseColorAllowColorless(String message, Card card, ColorSet colors) {
|
||||
return Iterables.getFirst(colors, (byte)0);
|
||||
return Iterables.getFirst(colors, MagicColor.Color.COLORLESS).getColorMask();
|
||||
}
|
||||
|
||||
private CardCollection chooseItems(CardCollectionView items, int amount) {
|
||||
|
||||
Reference in New Issue
Block a user