/// <summary> /// Creates a deck with the default cards, but does not shuffle it. /// </summary> /// <param name="shuffler"></param> public static Deck CreateDefault(IShufflingAlgorithm shuffler) { var cards = (from info in DeckInfo from index in Enumerable.Range(0, info.Value) select new Card(info.Key)); var retval = new Deck(shuffler); retval.Add(cards); return retval; }
public GameState(IDeckFactory deckFactory, IEnumerable<Player> players) { this.deckFactory = deckFactory; this.players = players.ToArray(); Table = new Table(); states = this.players.ToDictionary(p => p, p => new State()); readOnlyStates = states.ToDictionary(kvp => kvp.Key, kvp => (IPlayerState)kvp.Value).AsReadOnly(); deck = deckFactory.CreateDeck(); }