public override void Execute() { TurnScope.Publish(new CardSelectedToTrashForMineEvent(Item, TurnScope) { Id = Guid.NewGuid(), CorrelationId = this.OriginalEventId, OriginalEventId = this.OriginalEventId }); }
public override void Execute() { TurnScope.TrashCardFromHand(Item); if (TurnScope.Hand.Any()) { TurnScope.Publish(new SelectCardsToChapel(TurnScope)); } }
public void When_an_illegal_card_is_selected_action_phase_ends() { var eventAggregator = new MockEventAggregator(); var discardPile = new DiscardPile(); var deck = new Deck(7.Coppers(), 3.Estates()); var player = new Player(deck, discardPile, new NaivePlayerController()); var turnScope = new TurnScope(player, new Supply(), eventAggregator); var actionPhase = new ActionPhase(turnScope, new CardSet(Action.Village, Action.Village)); var response = actionPhase.PlayAction(Treasure.Copper); response.ShouldBeType <SkipActionPhaseResponse>(); }
public void When_an_valid_action_card_is_selected_action_the_action_will_be_played() { var eventAggregator = new MockEventAggregator(); var discardPile = new DiscardPile(); var deck = new Deck(7.Coppers(), 3.Estates()); var player = new Player(deck, discardPile, new NaivePlayerController()); var turnScope = new TurnScope(player, new Supply(), eventAggregator); var actionPhase = new ActionPhase(turnScope, new CardSet(Action.Village, Action.Village)); var response = actionPhase.PlayAction(Action.Village); response.ShouldBeType <PlayActionResponse>(); ((PlayActionResponse)response).Card.ShouldEqual <Card>(Action.Village); }
public void When_a_valid_card_is_selected_the_card_will_be_purchased() { var eventAggregator = new MockEventAggregator(); var discardPile = new DiscardPile(); var deck = new Deck(7.Coppers(), 3.Estates()); var player = new Player(deck, discardPile, new NaivePlayerController()); var supply = new Supply(new SupplyPile(1, Treasure.Silver, eventAggregator), new SupplyPile(1, Treasure.Copper, eventAggregator)); var scope = new TurnScope(player, supply, eventAggregator); player.DrawNewHand(scope); player.PlayTreasures(player.Hand.Treasures(), scope); var buyPhase = new BuyPhase(scope); player.BeginBuyPhase(buyPhase); eventAggregator.AssertMessageWasSent <PlayerGainedCardEvent>(); }
public void Resolve(IReactionScope scope) { var revealedTreasures = new CardSet(); 2.Times(() => { var revealedCard = scope.RevealCardFromDeck(); if (revealedCard.IsTreasure && !revealedTreasures.Contains(revealedCard)) { revealedTreasures.Add(revealedCard, scope); } }); if (revealedTreasures.Count() == 1) { scope.Publish(new TrashTreasureCardFromThief(TurnScope, scope, revealedTreasures.Single())); } else if (revealedTreasures.Count() == 2) { TurnScope.Publish(new ChooseTreasureCardToTrashFromThief(TurnScope, scope, revealedTreasures)); } }
public override void Execute() { TurnScope.GainCardFromSupplyOntoTopOfDeck(Item); }
public BuyCardResponse(ITurnScope turnScope, Card cardToPurchase) : base(turnScope) { Item = cardToPurchase; Description = String.Format("Buy a {0} {1} [{2} remaining]", Item.Name, TurnScope.GetPrice(Item), TurnScope.Supply == null || !TurnScope.Supply.ContainsKey(Item) ? 0 : TurnScope.Supply[Item].Count); }
public override void Execute() { TurnScope.ChangeState((-TurnScope.Actions).TurnActions()); TurnScope.Publish(this); }
public override void Execute() { TurnScope.Publish(this); }
public override void Execute() { TurnScope.GainCardFromSupply(_card); }
public override void Execute() { TurnScope.ChangeState(2.TurnCoins()); TurnScope.TrashCardInPlay(CardType.Of <MiningVillage>()); }
public override void Execute() { TurnScope.Discard(_card); }
public override void Execute() { TurnScope.TrashCardFromHand(new Feast().CardType); TurnScope.GainCardFromSupply(Item); }
public override void Execute() { _reactionScope.PutCardInTrash(Item); TurnScope.Publish(new ChooseWhetherToGainTrashedTreasureForThief(TurnScope, Item)); }
public void Resolve(IReactionScope scope) { TurnScope.Publish(new ChooseToDiscardOrReturnTopCardFromSpy(TurnScope, scope)); }
public override void Execute() { TurnScope.Publish(this); TurnScope.ChangeState((-TurnScope.Buys).TurnBuys()); }
public override void Execute() { TurnScope.PutCardFromHandIntoPlay(Item); 2.Times(() => Item.PlayAsAction(TurnScope)); }
public override void Execute() { TurnScope.PlayTreasures(TurnScope.TreasuresInHand); }
public override void Execute() { TurnScope.PlayAction(Card); }
public override void Execute() { TurnScope.MoveCardsFrom(TurnScope.Deck).Into(TurnScope.DiscardPile, TurnScope); }
public void PlayTreasures(CardSet treasuresToPlay, TurnScope turnScope) { }
public override void Execute() { TurnScope.PerformBuy(Item.CardType); }