public StartGameCommand(IDeckFactory deckFactory, IShufflingAlgorithm shufflingAlgorithm) { this.deckFactory = deckFactory; this.shufflingAlgorithm = shufflingAlgorithm; LocalEndpoint = new IPEndPoint(IPAddress.Loopback, 1234); RandomizePlayers = true; ValidateDeck = true; }
/// <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 DefaultDeckFactory(IShufflingAlgorithm shuffler) { this.shuffler = shuffler; }
public Deck(IShufflingAlgorithm shuffler) { this.shuffler = shuffler; this.content = new Queue<Card>(); this.pool = new List<Card>(); }
public CreateDeckCommand(IShufflingAlgorithm shufflingAlgorithm) { this.shufflingAlgorithm = shufflingAlgorithm; Shuffle = true; }