public LittleWackosStrategy() : base(StrategyName) { var deck = new ItalianDeckFactory().CreateDeck(); while (deck.Count > 0) { _unplayedCards.Add(deck.Pop()); } }
public Watcher() { var deck = new ItalianDeckFactory().CreateDeck(); while (deck.Count > 0) { _unplayedCards.Add(deck.Pop()); } }
public static GameState CreateHand(IStrategy sut, Card briscola, Card[] dish, Card[] handCards, int turn = 5) { var deck = new ItalianDeckFactory().CreateDeck(); turn = turn != 5 ? turn : new Random().Next(0, 4); var players = new List <IPlayer>(); for (int i = 0; i < 4; i++) { players.Add((4 - turn + i) % 4 != dish.Length ? new Player(new RandomStrategy(), "p" + i + 1) : new Player(sut, "p" + i + 1)); } GameState gameState = new GameState(players, briscola) { Turn = turn }; foreach (var player in players) { if (player.Strategy == sut) { foreach (var card in handCards) { player.Take(card); } } else { player.Take(deck.Pop()); player.Take(deck.Pop()); player.Take(deck.Pop()); } } foreach (var card in dish) { gameState.Dish.Add(card); } return(gameState); }
public ItalianDeckFactoryTest() { _sut = new ItalianDeckFactory(); }