mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -486,8 +486,8 @@ public final class GameActionUtil {
|
||||
}
|
||||
}
|
||||
else if (part instanceof CostSacrifice) {
|
||||
|
||||
CostSacrifice sacCost = (CostSacrifice)part;
|
||||
|
||||
CostSacrifice sacCost = (CostSacrifice) part;
|
||||
Player p = Singletons.getControl().getPlayer();
|
||||
String valid = sacCost.getType();
|
||||
int amount = Integer.parseInt(sacCost.getAmount());
|
||||
@@ -498,7 +498,7 @@ public final class GameActionUtil {
|
||||
hasPaid = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!showYesNoDialog(source, "Do you want to pay the sacrifice cost?")) {
|
||||
hasPaid = false;
|
||||
break;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class DamagePreventEffect extends SpellEffect {
|
||||
} else {
|
||||
sb.append(tgtC);
|
||||
}
|
||||
} else if (o instanceof Player){
|
||||
} else if (o instanceof Player) {
|
||||
sb.append(o.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2729,12 +2729,12 @@ public class CardFactoryUtil {
|
||||
|
||||
return CardFactoryUtil.doXMath(mmc, m, c);
|
||||
}
|
||||
|
||||
|
||||
//Count$Random.<Min>.<Max>
|
||||
if (sq[0].equals("Random")) {
|
||||
int min = Integer.parseInt(sq[1]);
|
||||
int max = Integer.parseInt(sq[2]);
|
||||
return forge.util.MyRandom.getRandom().nextInt(max)+min;
|
||||
return forge.util.MyRandom.getRandom().nextInt(max) + min;
|
||||
}
|
||||
|
||||
n = someCards.size();
|
||||
|
||||
@@ -84,7 +84,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final JCheckBox cbScaleLarger = new OptionsCheckBox("Scale Image Larger");
|
||||
private final JCheckBox cbRandomFoil = new OptionsCheckBox("Random Foil");
|
||||
private final JCheckBox cbEnableSounds = new OptionsCheckBox("Enable Sounds");
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@@ -147,7 +147,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
|
||||
pnlPrefs.add(cbEnableSounds, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Enable sound effects during the game."), regularConstraints);
|
||||
|
||||
|
||||
// Keyboard shortcuts
|
||||
final JLabel lblShortcuts = new SectionLabel("Keyboard Shortcuts");
|
||||
pnlPrefs.add(lblShortcuts, sectionConstraints);
|
||||
|
||||
@@ -85,18 +85,19 @@ public enum CSubmenuArchenemy implements ICDoc {
|
||||
|
||||
MatchStartHelper starter = new MatchStartHelper();
|
||||
Lobby lobby = Singletons.getControl().getLobby();
|
||||
|
||||
|
||||
PlayerStartConditions humanStart = new PlayerStartConditions(humanDeck);
|
||||
starter.addPlayer(lobby.findLocalPlayer(PlayerType.HUMAN), humanStart);
|
||||
humanStart.setStartingLife(10 + 10 * numFields); // will have 40 life to play against 3 opponents
|
||||
|
||||
for( int i = 0; i < numFields; i++ )
|
||||
|
||||
for (int i = 0; i < numFields; i++) {
|
||||
starter.addPlayer(lobby.findLocalPlayer(PlayerType.COMPUTER), DeckgenUtil.getRandomColorDeck(PlayerType.COMPUTER));
|
||||
|
||||
MatchController mc = Singletons.getModel().getMatch();
|
||||
}
|
||||
|
||||
MatchController mc = Singletons.getModel().getMatch();
|
||||
mc.initMatch(GameType.Constructed, starter.getPlayerMap());
|
||||
mc.startRound();
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,19 +135,18 @@ public enum CSubmenuVanguard implements ICDoc {
|
||||
for (int i = 0; i < view.getNumPlayers(); i++) {
|
||||
CardPrinted avatar = null;
|
||||
Object obj = view.getAvatarLists().get(i).getSelectedValue();
|
||||
|
||||
|
||||
boolean useDefault = VSubmenuVanguard.SINGLETON_INSTANCE.getCbDefaultAvatars().isSelected();
|
||||
useDefault &= playerDecks.get(i).getAvatar() != null;
|
||||
|
||||
if(useDefault)
|
||||
{
|
||||
|
||||
if (useDefault) {
|
||||
|
||||
avatar = playerDecks.get(i).getAvatar();
|
||||
defaultAvatarInfo.append("Player " + (i+1) + ": ");
|
||||
defaultAvatarInfo.append("Player " + (i + 1) + ": ");
|
||||
defaultAvatarInfo.append(avatar.getName() + nl);
|
||||
usedDefaults = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
|
||||
if (obj instanceof String) {
|
||||
//Random is the only string in the list so grab a random avatar.
|
||||
if (i == 0) {
|
||||
@@ -168,9 +167,9 @@ public enum CSubmenuVanguard implements ICDoc {
|
||||
}
|
||||
playerAvatars.add(avatar);
|
||||
}
|
||||
|
||||
if(usedDefaults)
|
||||
{
|
||||
|
||||
if (usedDefaults) {
|
||||
|
||||
GameActionUtil.showInfoDialg(defaultAvatarInfo.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum VSubmenuArchenemy implements IVSubmenu<CSubmenuArchenemy> {
|
||||
private final List<JRadioButton> fieldRadios = new ArrayList<JRadioButton>();
|
||||
private final StartButton btnStart = new StartButton();
|
||||
private final ButtonGroup grpFields = new ButtonGroup();
|
||||
|
||||
|
||||
private final FDeckChooser dcHuman = new FDeckChooser("Choose your deck", PlayerType.HUMAN);
|
||||
|
||||
private VSubmenuArchenemy() {
|
||||
@@ -88,7 +88,7 @@ public enum VSubmenuArchenemy implements IVSubmenu<CSubmenuArchenemy> {
|
||||
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(pnlFields, "w 41%!, gap 6% 6% 50px 0, growy, pushy");
|
||||
dcHuman.populate();
|
||||
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(dcHuman, "w 41%!, gap 0 0 50px 0, growy, pushy");
|
||||
|
||||
|
||||
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(new FLabel.Builder()
|
||||
.text("Starts a new game with preconstructed 2 color decks for each field.")
|
||||
.build(), "gap 0 0 50px 5px, ax center, span 2");
|
||||
|
||||
@@ -122,7 +122,7 @@ public enum VSubmenuVanguard implements IVSubmenu<CSubmenuVanguard> {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//This listener will look for an avatar being selected in the lists and update
|
||||
//the corresponding detail panel.
|
||||
ListSelectionListener lsListener = new ListSelectionListener() {
|
||||
@@ -131,13 +131,13 @@ public enum VSubmenuVanguard implements IVSubmenu<CSubmenuVanguard> {
|
||||
public void valueChanged(ListSelectionEvent arg0) {
|
||||
int index = avatarLists.indexOf(arg0.getSource());
|
||||
Object obj = avatarLists.get(index).getSelectedValue();
|
||||
|
||||
if(!(obj instanceof String))
|
||||
{
|
||||
cdpAvatarDetails.get(index).setCard(((CardPrinted)obj).toForgeCard());
|
||||
|
||||
if (!(obj instanceof String)) {
|
||||
|
||||
cdpAvatarDetails.get(index).setCard(((CardPrinted) obj).toForgeCard());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
//Create all 8 player settings panel
|
||||
@@ -153,7 +153,7 @@ public enum VSubmenuVanguard implements IVSubmenu<CSubmenuVanguard> {
|
||||
FPanel radioPane = new FPanel();
|
||||
radioPane.setLayout(new MigLayout("wrap 1"));
|
||||
radioPane.setOpaque(false);
|
||||
radioPane.add(new FLabel.Builder().text("Set number of opponents").build(),"wrap");
|
||||
radioPane.add(new FLabel.Builder().text("Set number of opponents").build(), "wrap");
|
||||
for (int i = 1; i < 8; i++) {
|
||||
tempRadio = new FRadioButton();
|
||||
tempRadio.setText(String.valueOf(i));
|
||||
@@ -163,7 +163,7 @@ public enum VSubmenuVanguard implements IVSubmenu<CSubmenuVanguard> {
|
||||
tempRadio.addItemListener(iListener);
|
||||
radioPane.add(tempRadio, "wrap,align 50% 50%");
|
||||
}
|
||||
settingsPanel.add(radioPane,"span 1 2");
|
||||
settingsPanel.add(radioPane, "span 1 2");
|
||||
settingsPanel.add(cbDefaultAvatars);
|
||||
tabPane.add("Settings", settingsPanel);
|
||||
|
||||
@@ -181,21 +181,21 @@ public enum VSubmenuVanguard implements IVSubmenu<CSubmenuVanguard> {
|
||||
tempList.setSelectedIndex(0);
|
||||
tempList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
tempList.addListSelectionListener(lsListener);
|
||||
|
||||
|
||||
deckChoosers.add(tempChooser);
|
||||
avatarLists.add(tempList);
|
||||
|
||||
tempPanel.add(tempChooser, "span 1 2, w 44%!, gap 0 0 20px 20px, growy, pushy, wrap");
|
||||
|
||||
tempPanel.add(new FLabel.Builder().text("Select Avatar:").build(),"flowy");
|
||||
tempPanel.add(new FLabel.Builder().text("Select Avatar:").build(), "flowy");
|
||||
|
||||
JScrollPane scrAvatar = new FScrollPane(tempList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
tempPanel.add(scrAvatar, "h 90%!,wrap");
|
||||
|
||||
|
||||
tempDetail = new CardDetailPanel(null);
|
||||
cdpAvatarDetails.add(tempDetail);
|
||||
|
||||
tempPanel.add(tempDetail,"span 1 2,growy,pushy,growx,pushx");
|
||||
|
||||
tempPanel.add(tempDetail, "span 1 2, growy, pushy, growx, pushx");
|
||||
|
||||
playerPanels.add(tempPanel);
|
||||
if (i == 0) {
|
||||
|
||||
Reference in New Issue
Block a user