mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Revert module separation to make another commit that would keep files' history
This commit is contained in:
999
.gitattributes
vendored
999
.gitattributes
vendored
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,11 @@
|
||||
<artifactId>forge-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>forge</groupId>
|
||||
<artifactId>forge-game</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -18,15 +18,5 @@
|
||||
<artifactId>forge-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode</groupId>
|
||||
<artifactId>minlog</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>forge</groupId>
|
||||
<artifactId>forge-ai</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package forge;
|
||||
|
||||
import forge.item.InventoryItem;
|
||||
|
||||
public class ImageCacheBridge {
|
||||
|
||||
public static Methods instance;
|
||||
|
||||
public interface Methods {
|
||||
String getImageKey(InventoryItem cp, boolean altState);
|
||||
String getTokenKey(String imageName);
|
||||
String getMorphImage();
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package forge;
|
||||
|
||||
|
||||
public class PreferencesBridge {
|
||||
public static PreferencesSet Instance;
|
||||
|
||||
public interface PreferencesSet {
|
||||
|
||||
public abstract boolean getEnableAiCheats();
|
||||
|
||||
public abstract boolean getCloneModeSource();
|
||||
|
||||
public abstract String getLogEntryType();
|
||||
|
||||
public abstract String getCurrentAiProfile();
|
||||
|
||||
public abstract boolean canRandomFoil();
|
||||
|
||||
public abstract boolean isManaBurnEnabled();
|
||||
|
||||
public abstract boolean areBlocksFree();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/** Forge Card Game. */
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author Max
|
||||
*
|
||||
*/
|
||||
package forge.game;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package forge;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: Command.java 21051 2013-04-17 11:48:06Z Max mtg $
|
||||
* @version $Id$
|
||||
*/
|
||||
public interface Command extends java.io.Serializable, Runnable {
|
||||
/** Constant <code>Blank</code>. */
|
||||
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: Constant.java 23713 2013-11-20 08:34:37Z Max mtg $
|
||||
* @version $Id$
|
||||
*/
|
||||
public final class Constant {
|
||||
// used to pass information between the GUI screens
|
||||
@@ -250,12 +250,6 @@ public class ImageCache {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getTokenImageKey(String tokenName) {
|
||||
return TOKEN_PREFIX + tokenName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static String getImageLocator(PaperCard cp, boolean backFace, boolean includeSet, boolean isDownloadUrl) {
|
||||
final String nameToUse = getNameToUse(cp, backFace);
|
||||
if ( null == nameToUse )
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package forge;
|
||||
|
||||
import forge.item.InventoryItem;
|
||||
import forge.properties.NewConstants;
|
||||
|
||||
public class ImageCacheProvider implements ImageCacheBridge.Methods {
|
||||
|
||||
@Override
|
||||
public String getImageKey(InventoryItem cp, boolean altState) {
|
||||
return ImageCache.getImageKey(cp, altState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTokenKey(String imageName) {
|
||||
return ImageCache.getTokenImageKey(imageName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMorphImage() {
|
||||
return NewConstants.CACHE_MORPH_IMAGE_FILE;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package forge;
|
||||
|
||||
import forge.PreferencesBridge.PreferencesSet;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
|
||||
public class PreferencesProvider implements PreferencesSet {
|
||||
@Override
|
||||
public boolean getEnableAiCheats() {
|
||||
return Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ENABLE_AI_CHEATS);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getCloneModeSource() {
|
||||
return Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_CLONE_MODE_SOURCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLogEntryType() {
|
||||
return Singletons.getModel().getPreferences().getPref(FPref.DEV_LOG_ENTRY_TYPE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCurrentAiProfile() {
|
||||
return Singletons.getModel().getPreferences().getPref(FPref.UI_CURRENT_AI_PROFILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRandomFoil() {
|
||||
return Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_RANDOM_FOIL);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isManaBurnEnabled() {
|
||||
// TODO Auto-generated method stub
|
||||
return Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_MANABURN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areBlocksFree() {
|
||||
return Singletons.getModel().getPreferences().getPrefBoolean(FPref.MATCHPREF_PROMPT_FREE_BLOCKS);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ import forge.game.zone.ZoneType;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: AiAttackController.java 24355 2014-01-19 01:33:24Z swordshine $
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AiAttackController {
|
||||
|
||||
@@ -43,7 +43,7 @@ import forge.game.trigger.TriggerType;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: AiBlockController.java 24355 2014-01-19 01:33:24Z swordshine $
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AiBlockController {
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.PreferencesBridge;
|
||||
import forge.Singletons;
|
||||
import forge.card.CardType;
|
||||
import forge.card.MagicColor;
|
||||
import forge.deck.CardPool;
|
||||
@@ -63,6 +63,7 @@ import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellPermanent;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.item.PaperCard;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Expressions;
|
||||
import forge.util.MyRandom;
|
||||
@@ -73,7 +74,7 @@ import forge.util.MyRandom;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: AiController.java 24379 2014-01-20 14:13:13Z swordshine $
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AiController {
|
||||
|
||||
@@ -99,7 +100,7 @@ public class AiController {
|
||||
player = computerPlayer;
|
||||
game = game0;
|
||||
|
||||
canCheatShuffle = PreferencesBridge.Instance.getEnableAiCheats();
|
||||
canCheatShuffle = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ENABLE_AI_CHEATS);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,6 +32,7 @@ import com.google.common.collect.Iterables;
|
||||
import forge.card.CardType;
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.CardType.Constant;
|
||||
import forge.error.BugReporter;
|
||||
import forge.game.Game;
|
||||
import forge.game.GameObject;
|
||||
import forge.game.ability.AbilityFactory;
|
||||
@@ -76,7 +77,7 @@ import forge.util.MyRandom;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: ComputerUtil.java 24317 2014-01-17 08:32:39Z Max mtg $
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ComputerUtil {
|
||||
|
||||
@@ -819,8 +820,8 @@ public class ComputerUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
} catch (final Exception ex) {
|
||||
throw new RuntimeException(String.format("There is an error in the card code for %s:%n", c.getName(), ex.getMessage()), ex);
|
||||
} catch (final Exception ex) {
|
||||
BugReporter.reportException(ex, "There is an error in the card code for %s:%n", c.getName(), ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -867,7 +868,8 @@ public class ComputerUtil {
|
||||
}
|
||||
}
|
||||
} catch (final Exception ex) {
|
||||
throw new RuntimeException(String.format("There is an error in the card code for %s:%n", c.getName(), ex.getMessage()), ex);
|
||||
BugReporter.reportException(ex, "There is an error in the card code for %s:%n", c.getName(),
|
||||
ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.mana.ManaAtom;
|
||||
import forge.card.mana.ManaCost;
|
||||
@@ -132,15 +133,15 @@ public class ComputerUtilMana {
|
||||
// select which abilities may be used for each shard
|
||||
MapOfLists<ManaCostShard, SpellAbility> sourcesForShards = ComputerUtilMana.groupAndOrderToPayShards(ai, manaAbilityMap, cost);
|
||||
|
||||
// if (DEBUG_MANA_PAYMENT) {
|
||||
// System.out.println((test ? "test -- " : "PROD -- ") + FThreads.debugGetStackTraceItem(5, true));
|
||||
// for (Entry<ManaCostShard, Collection<SpellAbility>> src : sourcesForShards.entrySet()) {
|
||||
// System.out.println("\t" +src.getKey() + " : " + src.getValue().size() + " source(s)");
|
||||
// for (SpellAbility sss : src.getValue()) {
|
||||
// System.out.printf("\t\t%s - %s%n", sss.getSourceCard(), sss);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (DEBUG_MANA_PAYMENT) {
|
||||
System.out.println((test ? "test -- " : "PROD -- ") + FThreads.debugGetStackTraceItem(5, true));
|
||||
for (Entry<ManaCostShard, Collection<SpellAbility>> src : sourcesForShards.entrySet()) {
|
||||
System.out.println("\t" +src.getKey() + " : " + src.getValue().size() + " source(s)");
|
||||
for (SpellAbility sss : src.getValue()) {
|
||||
System.out.printf("\t\t%s - %s%n", sss.getSourceCard(), sss);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<String> paymentPlan = new ArrayList<String>();
|
||||
|
||||
@@ -234,11 +235,11 @@ public class ComputerUtilMana {
|
||||
}
|
||||
handleOfferingsAI(sa, test, cost.isPaid());
|
||||
|
||||
// if (DEBUG_MANA_PAYMENT) {
|
||||
// System.err.printf("%s > [%s] payment has %s (%s +%d) for (%s) %s:%n\t%s%n%n",
|
||||
// FThreads.debugGetCurrThreadId(), test ? "test" : "PROD", cost.isPaid() ? "*PAID*" : "failed", originalCost,
|
||||
// extraMana, sa.getSourceCard(), sa.toUnsuppressedString(), StringUtils.join(paymentPlan, "\n\t"));
|
||||
// }
|
||||
if (DEBUG_MANA_PAYMENT) {
|
||||
System.err.printf("%s > [%s] payment has %s (%s +%d) for (%s) %s:%n\t%s%n%n",
|
||||
FThreads.debugGetCurrThreadId(), test ? "test" : "PROD", cost.isPaid() ? "*PAID*" : "failed", originalCost,
|
||||
extraMana, sa.getSourceCard(), sa.toUnsuppressedString(), StringUtils.join(paymentPlan, "\n\t"));
|
||||
}
|
||||
|
||||
if (!cost.isPaid()) {
|
||||
if (test) {
|
||||
@@ -30,7 +30,7 @@ import forge.game.spellability.SpellAbility;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: AddTurnAi.java 23792 2013-11-24 10:02:58Z Max mtg $
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AddTurnAi extends SpellAbilityAi {
|
||||
|
||||
@@ -34,7 +34,7 @@ import forge.util.Aggregates;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: CountersAi.java 23787 2013-11-24 07:09:23Z Max mtg $
|
||||
* @version $Id$
|
||||
*/
|
||||
public abstract class CountersAi {
|
||||
// An AbilityFactory subclass for Putting or Removing Counters on Cards.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user