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