mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
a small cleanup
This commit is contained in:
@@ -6,7 +6,6 @@ import java.util.Map.Entry;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.TargetChoices;
|
||||
import forge.game.GameOutcome;
|
||||
import forge.game.event.GameEventCardDamaged;
|
||||
@@ -65,28 +64,16 @@ public class GameLogFormatter extends IGameEventVisitor.Base<GameLogEntry> {
|
||||
|
||||
@Override
|
||||
public GameLogEntry visit(GameEventSpellAbilityCast event) {
|
||||
SpellAbility sp = event.sa;
|
||||
final List<TargetChoices> chosenTargets = sp.getAllTargetChoices();
|
||||
|
||||
String who = event.sa.getActivatingPlayer().getName();
|
||||
String action = event.sa.isSpell() ? " cast " : " activated ";
|
||||
String what = event.sa.getStackDescription().startsWith("Morph ") ? "Morph" : event.sa.getSourceCard().toString();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(sp.getActivatingPlayer());
|
||||
if (sp.isSpell()) {
|
||||
sb.append(" cast ");
|
||||
}
|
||||
else if (sp.isAbility()) {
|
||||
sb.append(" activated ");
|
||||
}
|
||||
sb.append(who).append(action).append(what);
|
||||
|
||||
if (sp.getStackDescription().startsWith("Morph ")) {
|
||||
sb.append("Morph");
|
||||
} else {
|
||||
sb.append(sp.getSourceCard());
|
||||
}
|
||||
|
||||
if (sp.getTarget() != null) {
|
||||
if (event.sa.getTarget() != null) {
|
||||
sb.append(" targeting ");
|
||||
for (TargetChoices ch : chosenTargets) {
|
||||
for (TargetChoices ch : event.sa.getAllTargetChoices()) {
|
||||
if (null != ch) {
|
||||
sb.append(ch.getTargetedString());
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import forge.card.spellability.Ability;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.game.Game;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
|
||||
|
||||
@@ -6,26 +6,12 @@ package forge.game.limited;
|
||||
* @author arman.sepetci
|
||||
*/
|
||||
public class DraftRankCache {
|
||||
|
||||
private static DraftRankCache instance = null;
|
||||
private static ReadDraftRankings rankings = null;
|
||||
|
||||
private DraftRankCache(){
|
||||
|
||||
}
|
||||
|
||||
public static DraftRankCache getInstance(){
|
||||
if (instance == null) {
|
||||
instance = new DraftRankCache();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DraftRankCache clone(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static Double getRanking(String name, String edition){
|
||||
if (rankings == null){
|
||||
rankings = new ReadDraftRankings();
|
||||
|
||||
Reference in New Issue
Block a user