mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -179,7 +179,7 @@ public class AbilityFactoryStoreSVar {
|
|||||||
*/
|
*/
|
||||||
public static String storeSVarStackDescription(final AbilityFactory af, final SpellAbility sa) {
|
public static String storeSVarStackDescription(final AbilityFactory af, final SpellAbility sa) {
|
||||||
final HashMap<String, String> params = af.getMapParams();
|
final HashMap<String, String> params = af.getMapParams();
|
||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
if (sa instanceof AbilitySub) {
|
if (sa instanceof AbilitySub) {
|
||||||
@@ -187,7 +187,7 @@ public class AbilityFactoryStoreSVar {
|
|||||||
} else {
|
} else {
|
||||||
sb.append(sa.getSourceCard().getName()).append(" - ");
|
sb.append(sa.getSourceCard().getName()).append(" - ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("StackDescription")) {
|
if (params.containsKey("StackDescription")) {
|
||||||
sb.append(params.get("StackDescription"));
|
sb.append(params.get("StackDescription"));
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@@ -264,42 +264,42 @@ public class AbilityFactoryStoreSVar {
|
|||||||
* a {@link forge.card.spellability.SpellAbility} object.
|
* a {@link forge.card.spellability.SpellAbility} object.
|
||||||
*/
|
*/
|
||||||
public static void storeSVarResolve(final AbilityFactory af, final SpellAbility sa) {
|
public static void storeSVarResolve(final AbilityFactory af, final SpellAbility sa) {
|
||||||
//SVar$ OldToughness | Type$ Count | Expression$ CardToughness
|
//SVar$ OldToughness | Type$ Count | Expression$ CardToughness
|
||||||
final HashMap<String, String> params = af.getMapParams();
|
final HashMap<String, String> params = af.getMapParams();
|
||||||
Card source = sa.getSourceCard();
|
Card source = sa.getSourceCard();
|
||||||
|
|
||||||
String key = null;
|
String key = null;
|
||||||
String type = null;
|
String type = null;
|
||||||
String expr = null;
|
String expr = null;
|
||||||
|
|
||||||
if (params.containsKey("SVar")) {
|
if (params.containsKey("SVar")) {
|
||||||
key = params.get("SVar");
|
key = params.get("SVar");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("Type")) {
|
if (params.containsKey("Type")) {
|
||||||
type = params.get("Type");
|
type = params.get("Type");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("Expression")) {
|
if (params.containsKey("Expression")) {
|
||||||
expr = params.get("Expression");
|
expr = params.get("Expression");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == null || type == null || expr == null) {
|
if (key == null || type == null || expr == null) {
|
||||||
System.out.println("SVar, Type and Expression paramaters required for StoreSVar. They are missing for " + source.getName());
|
System.out.println("SVar, Type and Expression paramaters required for StoreSVar. They are missing for " + source.getName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
|
||||||
if (type.equals("Count")) {
|
if (type.equals("Count")) {
|
||||||
value = CardFactoryUtil.xCount(source, expr);
|
value = CardFactoryUtil.xCount(source, expr);
|
||||||
}
|
}
|
||||||
//TODO For other types call a different function
|
//TODO For other types call a different function
|
||||||
|
|
||||||
StringBuilder numBuilder = new StringBuilder();
|
StringBuilder numBuilder = new StringBuilder();
|
||||||
numBuilder.append("Number$");
|
numBuilder.append("Number$");
|
||||||
numBuilder.append(value);
|
numBuilder.append(value);
|
||||||
|
|
||||||
source.setSVar(key, numBuilder.toString());
|
source.setSVar(key, numBuilder.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public abstract class AbilityStatic extends Ability {
|
|||||||
public AbilityStatic(final Card sourceCard, final String manaCost) {
|
public AbilityStatic(final Card sourceCard, final String manaCost) {
|
||||||
super(sourceCard, manaCost);
|
super(sourceCard, manaCost);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbilityStatic(final Card sourceCard, final Cost abCost, final Target tgt) {
|
public AbilityStatic(final Card sourceCard, final Cost abCost, final Target tgt) {
|
||||||
super(sourceCard, abCost.getTotalMana());
|
super(sourceCard, abCost.getTotalMana());
|
||||||
this.setManaCost(abCost.getTotalMana());
|
this.setManaCost(abCost.getTotalMana());
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
pnlParent.setBackgroundTexture(FSkin.getIcon(FSkin.Backgrounds.BG_TEXTURE));
|
pnlParent.setBackgroundTexture(FSkin.getIcon(FSkin.Backgrounds.BG_TEXTURE));
|
||||||
pnlParent.setLayout(null);
|
pnlParent.setLayout(null);
|
||||||
pnlParent.add(pnlLeft);
|
pnlParent.add(pnlLeft);
|
||||||
pnlParent.add(pnlRight);
|
pnlParent.add(pnlRight);
|
||||||
|
|
||||||
// Left pane holds scroller with menu panel.
|
// Left pane holds scroller with menu panel.
|
||||||
pnlMenu.setLayout(new MigLayout("insets 0, gap 0, wrap, hidemode 3"));
|
pnlMenu.setLayout(new MigLayout("insets 0, gap 0, wrap, hidemode 3"));
|
||||||
@@ -162,7 +162,7 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
allGroupPanels.get(e).setLayout(new MigLayout("insets 0, gap 0, wrap"));
|
allGroupPanels.get(e).setLayout(new MigLayout("insets 0, gap 0, wrap"));
|
||||||
allGroupPanels.get(e).setName(e.toString());
|
allGroupPanels.get(e).setName(e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// For each item: Add to its group, and add to the card layout in right panel.
|
// For each item: Add to its group, and add to the card layout in right panel.
|
||||||
for (final IVSubmenu item : allSubmenus) {
|
for (final IVSubmenu item : allSubmenus) {
|
||||||
allSubmenuLabels.put(EMenuItem.valueOf(item.getItemEnum()), makeItemLabel(item));
|
allSubmenuLabels.put(EMenuItem.valueOf(item.getItemEnum()), makeItemLabel(item));
|
||||||
@@ -183,7 +183,7 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
groupClick(e, allGroupLabels.get(e));
|
groupClick(e, allGroupLabels.get(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select previous
|
// Select previous
|
||||||
EMenuItem selected = null;
|
EMenuItem selected = null;
|
||||||
try {
|
try {
|
||||||
@@ -218,7 +218,7 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populate() {
|
public void populate() {
|
||||||
FView.SINGLETON_INSTANCE.getLpnDocument().add(pnlParent, JLayeredPane.DEFAULT_LAYER);
|
FView.SINGLETON_INSTANCE.getLpnDocument().add(pnlParent, JLayeredPane.DEFAULT_LAYER);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void groupClick(final EMenuGroup e0, final JLabel lbl0) {
|
private void groupClick(final EMenuGroup e0, final JLabel lbl0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user