public void ExecuteTurn(ICardPool pool) { Hand.DiscardTo(DiscardPile); PlayedCards.DiscardTo(DiscardPile); FillHand(); while (Hand.Any()) { var card = Hand[0]; Hand.RemoveAt(0); card.Play(this, null, pool); PlayedCards.Add(card); } var availableFunds = PlayedCards.Select(c => c.EType).Concat(new [] { Element.Free }).GroupBy(e => e).ToDictionary(g => g.Key, g => g.Count()); DiscardPile.AddRange(pool.BuyAll(availableFunds)); Console.WriteLine("Own {0} Cards:{1}", Collection.Count(), string.Join(", ", Collection.OrderBy(c => c.CardId).Select(c => c.ToString()))); }
public void Play(Player player1, Player player2, ICardPool pool) { Abilities(player1, player2, pool); }