public GainCardCostingUpToMessage(Money maxCost, ITurnScope turnScope) : base(turnScope) { Description = "Select a card costing up to " + maxCost + "."; GetAvailableResponses = () => turnScope.Supply.FindCardsCostingUpTo(maxCost, turnScope).OrderByDescending(c => c.BaseCost) .Select(c => new CardSelectedToGainResponse(c, turnScope)); }
public OptionallyDiscard(ITurnScope turnScope) : base(turnScope) { _doneDiscarding = new DoneDiscardingResponse(turnScope); GetAvailableResponses = () => turnScope.Hand.Select(c => new OptionalDiscardResponse(turnScope, c, this)) .Union(new IEventResponse[] { _doneDiscarding }) ; }
public Turn BeginTurn(ITurnScope scope) { var turn = new Turn(this, scope); turn.Begin(); return(turn); }
public void PlayAction(Card cardToPlay, ITurnScope turnScope) { if (this.Contains(cardToPlay)) { turnScope.PlayAction(cardToPlay); } }
public override void PlayAsAction(ITurnScope turnScope) { turnScope.ChangeState(1.TurnActions()); turnScope.Player.DrawIntoHand(1, turnScope); turnScope.Publish(new ChooseToDiscardOrReturnTopCardFromSpy(turnScope, turnScope)); turnScope.Publish(new SpyAttackEffect(turnScope)); }
public override void PlayAsAction(ITurnScope turnScope) { if (turnScope.Hand.Contains <Card>(Treasure.Copper)) { turnScope.TrashCardFromHand(Treasure.Copper); turnScope.ChangeState(3.TurnCoins()); } }
public PickCardToRemodelToCommand(Money cost, ITurnScope turnScope) : base(turnScope) { Description = String.Format("Select a card that costs up to {0} coins to remodel to.", cost); GetAvailableResponses = () => turnScope.Supply.FindCardsCostingUpTo(cost, turnScope).Select (c => new CardSelectedToRemodelToResponse(c, TurnScope)); }
public CardSet DrawIntoHand(int cards, ITurnScope turnScope) { var drawnCards = Deck.Draw(cards, turnScope); var cardsThatWereDrawn = new CardSet(drawnCards); drawnCards.Into(Hand, turnScope); return(cardsThatWereDrawn); }
public PlayActionResponse(ITurnScope turnScope, Card card) : base(turnScope) { if (card == null) { throw new ArgumentNullException("card"); } this.Card = card; this.Description = card.Name; }
public override void PlayAsAction(ITurnScope turnScope) { var id = Guid.NewGuid(); turnScope.Publish(new RemodelPlayedMessage(turnScope) { Id = id, OriginalEventId = id, CorrelationId = id }); }
public PickTreasureToUpgradeToForMineCommand(Money cost, ITurnScope scope) : base(scope) { Description = String.Format("Pick a treasure costing {0} to upgrade to [Mine]", cost); GetAvailableResponses = () => scope.Supply.FindCardsCostingUpTo(cost, scope) .Treasures().OrderByDescending(scope.GetPrice) .Select(t => new TreasurePickedToUpgradeToWithMine(t, scope)); }
public BuyPhase(ITurnScope turnScope) : base(turnScope) { Description = String.Format("{0}, select a card to buy", turnScope.Player.Name); GetAvailableResponses = () => (from card in TurnScope.Supply.FindCardsEligibleForPurchase(turnScope).OrderByDescending(c => c.BaseCost) select new BuyCardResponse(turnScope, card) { }).Union(new GameEventResponse[] { new DeclineToPurchaseResponse(turnScope) }) ; }
public ActionPhase(ITurnScope turnScope, CardSet availableActions) : base(turnScope) { Description = String.Format("{0}, select an action to play", turnScope.Player.Name); AvailableActions = new CardSet(availableActions.OrderByDescending(a => a.BaseCost).ToList()); AvailableActions.ToList().ForEach(actionCard => _availableResponses.Add(new PlayActionResponse(turnScope, actionCard))); if (_availableResponses.Any()) { _availableResponses.Add(new SkipActionPhaseResponse(turnScope)); } }
public ActionDrawnForLibrary(Card action, LibraryState state, ITurnScope scope) : base(scope) { Description = "Take " + action.Name + " into hand, or set it aside?"; _action = action; GetAvailableResponses = () => new List <IEventResponse> { new SetAsideActionForLibrary(scope, state, action), new TakeActionCardIntoHandForLibrary(scope, state, action) }; }
public CardSelectedToTrashForMineEvent(Card card, ITurnScope turnScope) : base(turnScope) { if (card == null) { throw new ArgumentNullException("card"); } _card = card; Description = string.Format("{0} trashed {1}", turnScope.Player.Name, card.Name); }
public PickCardToRemodelCommand(ITurnScope turnScope) : base(turnScope) { Description = "Select a card from your hand to remodel [Remodel]."; GetAvailableResponses = () => turnScope.Player.Hand.Select(c => new CardSelectedToRemodelResponse(turnScope, c) { Id = Guid.NewGuid(), CorrelationId = this.CorrelationId, OriginalEventId = this.OriginalEventId }) .Append <GameEventResponse>(new DeclinedToRemodelCardResponse(turnScope)); }
public ReactionScope(IEventAggregator eventAggregator, Player actingPlayer, Player reactingPlayer, ITurnScope originatingTurnScope, TrashPile trashPile, Supply supply) : base(supply, eventAggregator, trashPile, 1) { _player = reactingPlayer; _actingPlayer = actingPlayer; _reactingPlayer = reactingPlayer; _originatingTurnScope = originatingTurnScope; _trashPile = trashPile; _eventPipeline = new EventFilterPipeline(_reactingPlayer); }
public PickTreasureToTrashForMineCommand(ITurnScope scope) : base(scope) { Description = "Select a treasure to trash [Mine]"; GetAvailableResponses = () => scope.Player.Hand.Treasures() .Select( t => new TrashCardForMineResponse(scope) { Id = Guid.NewGuid(), CorrelationId = this.OriginalEventId, OriginalEventId = this.OriginalEventId, Item = t }) .Append <GameEventResponse>(new DeclinedToTrashCardForMineResponse(TurnScope)); }
public override void PlayAsAction(ITurnScope turnScope) { while (turnScope.Player.Hand.Count() < 7) { var state = new LibraryState(); turnScope.DrawCardIntoCardset(state.DrawnCards); var card = state.DrawnCards.First(); if (card.IsAction) { turnScope.Publish(new ActionDrawnForLibrary(card, state, turnScope)); } else { state.DrawnCards.Add(card, turnScope); } turnScope.PutCardsIntoHand(state.DrawnCards); turnScope.Discard(state.SetAsideCards); } }
public override void PlayAsAction(ITurnScope turnScope) { CardSet drawnTreasures = new CardSet(); CardSet revealedCards = new CardSet(); do { var card = turnScope.RevealCardFromTopOfDeck(); if (card.IsTreasure) { drawnTreasures.Add(card, turnScope); } else { revealedCards.Add(card, turnScope); } } while (drawnTreasures.Count() < 2); turnScope.PutCardsIntoHand(drawnTreasures); turnScope.PutCardsIntoDiscardPile(revealedCards); }
public CardSet FindCardsEligibleForPurchase(ITurnScope turnScope) { return(new CardSet()); }
public void GainCardFromSupply(Card cardToUpgradeTo, ITurnScope turnScope) { }
public CardSet FindCardsEligibleForPurchase(ITurnScope turnScope) { return(Supply.FindCardsEligibleForPurchase(turnScope)); }
public override int Score(ITurnScope scope) { return(scope.Deck.Count() / 10); }
public override void PlayAsAction(ITurnScope turnScope) { turnScope.ChangeState(2.TurnCoins()); turnScope.Publish(new AttackCardPlayed(this, turnScope)); turnScope.Publish(new MilitiaAttackEffect(turnScope)); }
public CardSet DrawIntoHand(int cards, ITurnScope turnScope) { throw new NotImplementedException(); }
public Turn BeginTurn(ITurnScope scope) { throw new NotImplementedException(); }
public void BeginCleanupPhase(ITurnScope turnScope) { }
public void DiscardHand(ITurnScope turnScope) { }
public void DrawNewHand(ITurnScope turnScope) { }