several mechanical refactorings

This commit is contained in:
Ryan1729
2019-09-11 21:23:27 -06:00
parent 434027c14f
commit b76a3c3efa
13 changed files with 117 additions and 87 deletions

View File

@@ -894,10 +894,10 @@ public class GameAction {
// preList means that this is run by a pre Check with LKI objects // preList means that this is run by a pre Check with LKI objects
// in that case Always trigger should not Run // in that case Always trigger should not Run
if (preList.isEmpty()) { if (preList.isEmpty()) {
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
game.getTriggerHandler().runTriggerOld(TriggerType.Always, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Always, runParams, false);
game.getTriggerHandler().runTriggerOld(TriggerType.Immediate, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Immediate, runParams, false);
} }
// Update P/T and type in the view only once after all the cards have been processed, to avoid flickering // Update P/T and type in the view only once after all the cards have been processed, to avoid flickering
@@ -1416,10 +1416,10 @@ public class GameAction {
game.fireEvent(new GameEventCardDestroyed()); game.fireEvent(new GameEventCardDestroyed());
// Run triggers // Run triggers
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Card", c); runParams.put(AbilityKey.Card, c);
runParams.put("Causer", activator); runParams.put(AbilityKey.Causer, activator);
game.getTriggerHandler().runTriggerOld(TriggerType.Destroyed, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Destroyed, runParams, false);
final Card sacrificed = sacrificeDestroy(c, sa, table); final Card sacrificed = sacrificeDestroy(c, sa, table);
return sacrificed != null; return sacrificed != null;
@@ -1596,8 +1596,7 @@ public class GameAction {
checkStateEffects(true); // why? checkStateEffects(true); // why?
// Run Trigger beginning of the game // Run Trigger beginning of the game
final Map<String, Object> runParams = Maps.newHashMap(); game.getTriggerHandler().runTrigger(TriggerType.NewGame, AbilityKey.newMap(), true);
game.getTriggerHandler().runTriggerOld(TriggerType.NewGame, runParams, true);
//</THIS CODE WILL WORK WITH PHASE = NULL> //</THIS CODE WILL WORK WITH PHASE = NULL>
@@ -1760,9 +1759,9 @@ public class GameAction {
game.setMonarch(p); game.setMonarch(p);
// Run triggers // Run triggers
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Player", p); runParams.put(AbilityKey.Player, p);
game.getTriggerHandler().runTriggerOld(TriggerType.BecomeMonarch, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.BecomeMonarch, runParams, false);
} }
// Make scry an action function so that it can be used for mulligans (with a null cause) // Make scry an action function so that it can be used for mulligans (with a null cause)
@@ -1822,9 +1821,9 @@ public class GameAction {
if (cause != null) { if (cause != null) {
// set up triggers (but not actually do them until later) // set up triggers (but not actually do them until later)
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Player", p); runParams.put(AbilityKey.Player, p);
game.getTriggerHandler().runTriggerOld(TriggerType.Scry, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Scry, runParams, false);
} }
} }
} }

View File

@@ -17,6 +17,7 @@
*/ */
package forge.game; package forge.game;
import forge.game.ability.AbilityKey;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardCollection; import forge.game.card.CardCollection;
import forge.game.card.CardCollectionView; import forge.game.card.CardCollectionView;
@@ -214,13 +215,13 @@ public abstract class GameEntity extends GameObject implements IIdentifiable {
int prevent = damage - restDamage; int prevent = damage - restDamage;
preventMap.put(source, this, damage - restDamage); preventMap.put(source, this, damage - restDamage);
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("DamageTarget", this); runParams.put(AbilityKey.DamageTarget, this);
runParams.put("DamageAmount", prevent); runParams.put(AbilityKey.DamageAmount, prevent);
runParams.put("DamageSource", source); runParams.put(AbilityKey.DamageSource, source);
runParams.put("IsCombatDamage", isCombat); runParams.put(AbilityKey.IsCombatDamage, isCombat);
getGame().getTriggerHandler().runTriggerOld(TriggerType.DamagePrevented, runParams, false); getGame().getTriggerHandler().runTrigger(TriggerType.DamagePrevented, runParams, false);
} }
return restDamage; return restDamage;

View File

@@ -7,6 +7,7 @@ import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Table; import com.google.common.collect.Table;
import forge.game.ability.AbilityKey;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CounterType; import forge.game.card.CounterType;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
@@ -47,9 +48,9 @@ public class GameEntityCounterTable extends ForwardingTable<GameEntity, CounterT
public void triggerCountersPutAll(final Game game) { public void triggerCountersPutAll(final Game game) {
if (!isEmpty()) { if (!isEmpty()) {
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Objects", this); runParams.put(AbilityKey.Objects, this);
game.getTriggerHandler().runTriggerOld(TriggerType.CounterAddedAll, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.CounterAddedAll, runParams, false);
} }
} }
} }

View File

@@ -1,9 +1,11 @@
package forge.game; package forge.game;
import forge.game.ability.AbilityKey;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.trigger.TriggerType; import forge.game.trigger.TriggerType;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@@ -36,10 +38,10 @@ public enum PlanarDice {
trigRes = Chaos; trigRes = Chaos;
} }
HashMap<String,Object> runParams = new HashMap<>(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Player", roller); runParams.put(AbilityKey.Player, roller);
runParams.put("Result", trigRes); runParams.put(AbilityKey.Result, trigRes);
roller.getGame().getTriggerHandler().runTriggerOld(TriggerType.PlanarDice, runParams,false); roller.getGame().getTriggerHandler().runTrigger(TriggerType.PlanarDice, runParams,false);
return res; return res;

View File

@@ -7,23 +7,41 @@ import java.util.EnumMap;
*/ */
public enum AbilityKey { public enum AbilityKey {
Affected("Affected"), Affected("Affected"),
Attacker("Attacker"),
Attackers("Attackers"), Attackers("Attackers"),
AttackingPlayer("AttackingPlayer"), AttackingPlayer("AttackingPlayer"),
AttackedTarget("AttackedTarget"), AttackedTarget("AttackedTarget"),
Blocker("Blocker"),
Blockers("Blockers"),
Card("Card"), Card("Card"),
CardLKI("CardLKI"), CardLKI("CardLKI"),
Cause("Cause"), Cause("Cause"),
Causer("Causer"),
Championed("Championed"),
CounteredSA("CounteredSA"), CounteredSA("CounteredSA"),
DamageAmount("DamageAmount"),
DamageSource("DamageSource"),
DamageTarget("DamageTarget"),
Defender("Defender"),
DefendingPlayer("DefendingPlayer"),
Destination("Destination"), Destination("Destination"),
Event("Event"), Event("Event"),
Fizzle("Fizzle"), Fizzle("Fizzle"),
IsCombatDamage("IsCombatDamage"),
Player("Player"), Player("Player"),
IndividualCostPaymentInstance("IndividualCostPaymentInstance"), IndividualCostPaymentInstance("IndividualCostPaymentInstance"),
MonstrosityAmount("MonstrosityAmount"),
NumBlockers("NumBlockers"),
Objects("Objects"),
Origin("Origin"), Origin("Origin"),
OriginalController("OriginalController"), OriginalController("OriginalController"),
Result("Result"),
Scheme("Scheme"),
SpellAbilityStackInstance("SpellAbilityStackInstance"), SpellAbilityStackInstance("SpellAbilityStackInstance"),
StackSa("StackSa"), StackSa("StackSa"),
StackSi("StackSi"); StackSi("StackSi"),
Target("Target"),
Won("Won");
private String key; private String key;

View File

@@ -2,6 +2,7 @@ package forge.game.ability.effects;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import forge.game.Game; import forge.game.Game;
import forge.game.ability.AbilityKey;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.player.Player; import forge.game.player.Player;
@@ -40,9 +41,9 @@ public class AbandonEffect extends SpellAbilityEffect {
controller.getZone(ZoneType.SchemeDeck).add(source); controller.getZone(ZoneType.SchemeDeck).add(source);
// Run triggers // Run triggers
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Scheme", source); runParams.put(AbilityKey.Scheme, source);
game.getTriggerHandler().runTriggerOld(TriggerType.Abandoned, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Abandoned, runParams, false);
} }
} }

View File

@@ -1,6 +1,7 @@
package forge.game.ability.effects; package forge.game.ability.effects;
import forge.game.Game; import forge.game.Game;
import forge.game.ability.AbilityKey;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.event.GameEventCombatChanged; import forge.game.event.GameEventCombatChanged;
@@ -40,13 +41,13 @@ public class BecomesBlockedEffect extends SpellAbilityEffect {
game.getCombat().setBlocked(c, true); game.getCombat().setBlocked(c, true);
if (!c.getDamageHistory().getCreatureGotBlockedThisCombat()) { if (!c.getDamageHistory().getCreatureGotBlockedThisCombat()) {
isCombatChanged = true; isCombatChanged = true;
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Attacker", c); runParams.put(AbilityKey.Attacker, c);
runParams.put("Blockers", Lists.<Card>newArrayList()); runParams.put(AbilityKey.Blockers, Lists.<Card>newArrayList());
runParams.put("NumBlockers", 0); runParams.put(AbilityKey.NumBlockers, 0);
runParams.put("Defender", game.getCombat().getDefenderByAttacker(c)); runParams.put(AbilityKey.Defender, game.getCombat().getDefenderByAttacker(c));
runParams.put("DefendingPlayer", game.getCombat().getDefenderPlayerByAttacker(c)); runParams.put(AbilityKey.DefendingPlayer, game.getCombat().getDefenderPlayerByAttacker(c));
game.getTriggerHandler().runTriggerOld(TriggerType.AttackerBlocked, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.AttackerBlocked, runParams, false);
} }
} }
} }

View File

@@ -1,6 +1,7 @@
package forge.game.ability.effects; package forge.game.ability.effects;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
@@ -53,26 +54,28 @@ public class BlockEffect extends SpellAbilityEffect {
blocker.addBlockedThisTurn(attacker); blocker.addBlockedThisTurn(attacker);
attacker.addBlockedByThisTurn(blocker); attacker.addBlockedByThisTurn(blocker);
Map<String, Object> runParams = Maps.newHashMap(); {
runParams.put("Attacker", attacker); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Blocker", blocker); runParams.put(AbilityKey.Attacker, attacker);
game.getTriggerHandler().runTriggerOld(TriggerType.AttackerBlockedByCreature, runParams, false); runParams.put(AbilityKey.Blocker, blocker);
game.getTriggerHandler().runTrigger(TriggerType.AttackerBlockedByCreature, runParams, false);
}
runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Blocker", blocker); runParams.put(AbilityKey.Blocker, blocker);
runParams.put("Attackers", attacker); runParams.put(AbilityKey.Attackers, attacker);
game.getTriggerHandler().runTriggerOld(TriggerType.Blocks, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Blocks, runParams, false);
} }
attacker.getDamageHistory().setCreatureGotBlockedThisCombat(true); attacker.getDamageHistory().setCreatureGotBlockedThisCombat(true);
if (!wasBlocked) { if (!wasBlocked) {
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Attacker", attacker); runParams.put(AbilityKey.Attacker, attacker);
runParams.put("Blockers", blockers); runParams.put(AbilityKey.Blockers, blockers);
runParams.put("NumBlockers", blockers.size()); runParams.put(AbilityKey.NumBlockers, blockers.size());
runParams.put("Defender", combat.getDefenderByAttacker(attacker)); runParams.put(AbilityKey.Defender, combat.getDefenderByAttacker(attacker));
runParams.put("DefendingPlayer", combat.getDefenderPlayerByAttacker(attacker)); runParams.put(AbilityKey.DefendingPlayer, combat.getDefenderPlayerByAttacker(attacker));
game.getTriggerHandler().runTriggerOld(TriggerType.AttackerBlocked, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.AttackerBlocked, runParams, false);
combat.orderBlockersForDamageAssignment(attacker, new CardCollection(blockers)); combat.orderBlockersForDamageAssignment(attacker, new CardCollection(blockers));
} }

View File

@@ -4,6 +4,7 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import forge.game.Game; import forge.game.Game;
import forge.game.GameActionUtil; import forge.game.GameActionUtil;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.*; import forge.game.card.*;
@@ -79,10 +80,10 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
if (!libCards.isEmpty()) { if (!libCards.isEmpty()) {
sa.getActivatingPlayer().getController().reveal(libCards, ZoneType.Library, libCards.get(0).getOwner()); sa.getActivatingPlayer().getController().reveal(libCards, ZoneType.Library, libCards.get(0).getOwner());
} }
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Player", sa.getActivatingPlayer()); runParams.put(AbilityKey.Player, sa.getActivatingPlayer());
runParams.put("Target", tgtPlayers); runParams.put(AbilityKey.Target, tgtPlayers);
game.getTriggerHandler().runTriggerOld(TriggerType.SearchedLibrary, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.SearchedLibrary, runParams, false);
} }
if (origin.contains(ZoneType.Hand) && sa.hasParam("Search")) { if (origin.contains(ZoneType.Hand) && sa.hasParam("Search")) {
CardCollection handCards = CardLists.filterControlledBy(CardLists.getValidCards(cards, "Card.inZoneHand", sa.getActivatingPlayer(), source), CardCollection handCards = CardLists.filterControlledBy(CardLists.getValidCards(cards, "Card.inZoneHand", sa.getActivatingPlayer(), source),

View File

@@ -831,10 +831,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
} }
} }
} }
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Player", decider); runParams.put(AbilityKey.Player, decider);
runParams.put("Target", Lists.newArrayList(player)); runParams.put(AbilityKey.Target, Lists.newArrayList(player));
decider.getGame().getTriggerHandler().runTriggerOld(TriggerType.SearchedLibrary, runParams, false); decider.getGame().getTriggerHandler().runTrigger(TriggerType.SearchedLibrary, runParams, false);
} }
if (!defined && changeType != null) { if (!defined && changeType != null) {
@@ -1132,10 +1132,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
} }
if (champion) { if (champion) {
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Card", source); runParams.put(AbilityKey.Card, source);
runParams.put("Championed", c); runParams.put(AbilityKey.Championed, c);
game.getTriggerHandler().runTriggerOld(TriggerType.Championed, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Championed, runParams, false);
} }
if (remember) { if (remember) {

View File

@@ -2,6 +2,7 @@ package forge.game.ability.effects;
import forge.game.GameAction; import forge.game.GameAction;
import forge.game.GameLogEntryType; import forge.game.GameLogEntryType;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
@@ -13,6 +14,7 @@ import forge.game.zone.PlayerZone;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
public class ClashEffect extends SpellAbilityEffect { public class ClashEffect extends SpellAbilityEffect {
@@ -32,8 +34,8 @@ public class ClashEffect extends SpellAbilityEffect {
final boolean victory = clashWithOpponent(sa); final boolean victory = clashWithOpponent(sa);
// Run triggers // Run triggers
final HashMap<String, Object> runParams = new HashMap<>(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Player", sa.getHostCard().getController()); runParams.put(AbilityKey.Player, sa.getHostCard().getController());
if (victory) { if (victory) {
@@ -42,18 +44,18 @@ public class ClashEffect extends SpellAbilityEffect {
AbilityUtils.resolve(sub); AbilityUtils.resolve(sub);
} }
runParams.put("Won", "True"); runParams.put(AbilityKey.Won, "True");
} else { } else {
AbilitySub sub = sa.getAdditionalAbility("OtherwiseSubAbility"); AbilitySub sub = sa.getAdditionalAbility("OtherwiseSubAbility");
if (sub != null) { if (sub != null) {
AbilityUtils.resolve(sub); AbilityUtils.resolve(sub);
} }
runParams.put("Won", "False"); runParams.put(AbilityKey.Won, "False");
} }
sa.getHostCard().getGame().getTriggerHandler().runTriggerOld(TriggerType.Clashed, runParams, false); sa.getHostCard().getGame().getTriggerHandler().runTrigger(TriggerType.Clashed, runParams, false);
} }
/** /**

View File

@@ -8,6 +8,7 @@ import forge.game.Game;
import forge.game.GameEntity; import forge.game.GameEntity;
import forge.game.GameEntityCounterTable; import forge.game.GameEntityCounterTable;
import forge.game.GameObject; import forge.game.GameObject;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
@@ -260,29 +261,29 @@ public class CountersPutEffect extends SpellAbilityEffect {
} }
if (sa.hasParam("Evolve")) { if (sa.hasParam("Evolve")) {
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Card", tgtCard); runParams.put(AbilityKey.Card, tgtCard);
game.getTriggerHandler().runTriggerOld(TriggerType.Evolved, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Evolved, runParams, false);
} }
if (sa.hasParam("Monstrosity")) { if (sa.hasParam("Monstrosity")) {
tgtCard.setMonstrous(true); tgtCard.setMonstrous(true);
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Card", tgtCard); runParams.put(AbilityKey.Card, tgtCard);
runParams.put("MonstrosityAmount", counterAmount); runParams.put(AbilityKey.MonstrosityAmount, counterAmount);
game.getTriggerHandler().runTriggerOld(TriggerType.BecomeMonstrous, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.BecomeMonstrous, runParams, false);
} }
if (sa.hasParam("Renown")) { if (sa.hasParam("Renown")) {
tgtCard.setRenowned(true); tgtCard.setRenowned(true);
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Card", tgtCard); runParams.put(AbilityKey.Card, tgtCard);
game.getTriggerHandler().runTriggerOld(TriggerType.BecomeRenowned, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.BecomeRenowned, runParams, false);
} }
if (sa.hasParam("Adapt")) { if (sa.hasParam("Adapt")) {
// need to remove special keyword // need to remove special keyword
tgtCard.removeHiddenExtrinsicKeyword("CARDNAME adapts as though it had no +1/+1 counters"); tgtCard.removeHiddenExtrinsicKeyword("CARDNAME adapts as though it had no +1/+1 counters");
final Map<String, Object> runParams = Maps.newHashMap(); final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put("Card", tgtCard); runParams.put(AbilityKey.Card, tgtCard);
game.getTriggerHandler().runTriggerOld(TriggerType.Adapt, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Adapt, runParams, false);
} }
} else { } else {
// adding counters to something like re-suspend cards // adding counters to something like re-suspend cards

View File

@@ -2,6 +2,7 @@ package forge.gamesimulationtests.util;
import forge.deck.Deck; import forge.deck.Deck;
import forge.game.*; import forge.game.*;
import forge.game.ability.AbilityKey;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.event.GameEventGameFinished; import forge.game.event.GameEventGameFinished;
import forge.game.player.Player; import forge.game.player.Player;
@@ -137,8 +138,7 @@ public class GameWrapper {
//game.getAction().startGame( null ) determines starting player, draws starting hands, handles mulligans, and initiates the first turn //game.getAction().startGame( null ) determines starting player, draws starting hands, handles mulligans, and initiates the first turn
//skip drawing initial hand and mulliganing //skip drawing initial hand and mulliganing
game.setAge( GameStage.Play ); game.setAge( GameStage.Play );
final HashMap<String, Object> runParams = new HashMap<>(); game.getTriggerHandler().runTrigger(TriggerType.NewGame, AbilityKey.newMap(), false);
game.getTriggerHandler().runTriggerOld( TriggerType.NewGame, runParams, false );
//first player in the list starts, no coin toss etc //first player in the list starts, no coin toss etc
game.getPhaseHandler().startFirstTurn( game.getPlayers().get( 0 ) ); game.getPhaseHandler().startFirstTurn( game.getPlayers().get( 0 ) );