mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -98,8 +98,8 @@ public class ReplacementHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if (chosenRE != null) {
|
||||
if(executeReplacement(runParams, chosenRE, decider)) {
|
||||
if (chosenRE != null) {
|
||||
if (executeReplacement(runParams, chosenRE, decider)) {
|
||||
AllZone.getGameLog().add("ReplacementEffect", chosenRE.toString(), 2);
|
||||
return true;
|
||||
}
|
||||
@@ -121,10 +121,10 @@ public class ReplacementHandler {
|
||||
|
||||
HashMap<String, String> mapParams = replacementEffect.getMapParams();
|
||||
replacementEffect.setHasRun(true);
|
||||
|
||||
|
||||
SpellAbility effectSA = null;
|
||||
|
||||
if(mapParams.containsKey("ReplaceWith")) {
|
||||
|
||||
if (mapParams.containsKey("ReplaceWith")) {
|
||||
String effectSVar = mapParams.get("ReplaceWith");
|
||||
String effectAbString = replacementEffect.getHostCard().getSVar(effectSVar);
|
||||
|
||||
@@ -134,14 +134,14 @@ public class ReplacementHandler {
|
||||
|
||||
replacementEffect.setReplacingObjects(runParams, effectSA);
|
||||
}
|
||||
|
||||
|
||||
//Decider gets to choose wether or not to apply the replacement.
|
||||
if (replacementEffect.getMapParams().containsKey("Optional")) {
|
||||
Player optDecider = decider;
|
||||
if(mapParams.containsKey("OptionalDecider") && effectSA != null) {
|
||||
if (mapParams.containsKey("OptionalDecider") && effectSA != null) {
|
||||
optDecider = AbilityFactory.getDefinedPlayers(replacementEffect.getHostCard(), mapParams.get("OptionalDecider"), effectSA).get(0);
|
||||
}
|
||||
|
||||
|
||||
if (optDecider.isHuman()) {
|
||||
StringBuilder buildQuestion = new StringBuilder("Apply replacement effect of ");
|
||||
buildQuestion.append(replacementEffect.getHostCard());
|
||||
@@ -153,7 +153,7 @@ public class ReplacementHandler {
|
||||
}
|
||||
} else {
|
||||
//AI-logic
|
||||
if(!replacementEffect.aiShouldRun(effectSA)) {
|
||||
if (!replacementEffect.aiShouldRun(effectSA)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class ReplacementHandler {
|
||||
replacementEffect.setHasRun(false);
|
||||
return true; //Nothing should replace the event.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (replacementEffect.getHostCard().getController().isHuman()) {
|
||||
AllZone.getGameAction().playSpellAbilityNoStack(effectSA, false);
|
||||
@@ -174,7 +174,7 @@ public class ReplacementHandler {
|
||||
}
|
||||
|
||||
replacementEffect.setHasRun(false);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,11 @@ public class FModel {
|
||||
return this.gameState;
|
||||
}
|
||||
|
||||
/** TODO: Needs to be reworked for efficiency with rest of prefs saves in codebase. */
|
||||
/**
|
||||
* TODO: Needs to be reworked for efficiency with rest of prefs saves in codebase.
|
||||
*
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean savePrefs() {
|
||||
final ForgePreferences fp = preferences;
|
||||
final List<ViewField> fieldViews = Singletons.getView().getMatchView().getFieldViews();
|
||||
@@ -354,7 +358,11 @@ public class FModel {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** TODO: Needs to be reworked for efficiency with rest of prefs loads in codebase. */
|
||||
/**
|
||||
* TODO: Needs to be reworked for efficiency with rest of prefs loads in codebase.
|
||||
*
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean loadPrefs() {
|
||||
final ForgePreferences fp = Singletons.getModel().getPreferences();
|
||||
final List<ViewField> fieldViews = Singletons.getView().getMatchView().getFieldViews();
|
||||
|
||||
@@ -77,15 +77,15 @@ public class SectionUtil {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static Map<String, String> parseKvPairs(List<String> lines) {
|
||||
Map<String,String> result = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
|
||||
|
||||
Map<String, String> result = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
|
||||
|
||||
for (final String dd : lines) {
|
||||
final String[] v = dd.split(":", 2);
|
||||
result.put(v[0], v.length > 1 ? v[1].trim() : "");
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user