public TrucoDeck(TrucoDeckType type) : base() { PrepareTrucoDeck(type); }
private void PrepareTrucoDeck(TrucoDeckType type) { IEnumerable<Card> invalidCards; if (type == TrucoDeckType.Short) invalidCards = this.Where(c => new int[] { 4, 5, 6, 7, 8, 9, 10 }.Contains(c.Value)); else invalidCards = this.Where(c => new int[] { 8, 9, 10 }.Contains(c.Value)); IEnumerable<Card> validCards = this.Except(invalidCards); this.Clear(); this.AddRange(validCards); }
private void PrepareTrucoDeck(TrucoDeckType type) { IEnumerable <Card> invalidCards; if (type == TrucoDeckType.Short) { invalidCards = this.Where(c => new int[] { 4, 5, 6, 7, 8, 9, 10 }.Contains(c.Value)); } else { invalidCards = this.Where(c => new int[] { 8, 9, 10 }.Contains(c.Value)); } IEnumerable <Card> validCards = this.Except(invalidCards); this.Clear(); this.AddRange(validCards); }
public Game(Player p1, Player p2, Player p3, Player p4, TrucoDeckType gameType) : this(p1, p2, gameType) { P3 = p3; P4 = p4; }
public Game(Player p1, Player p2, TrucoDeckType gameType) { P1 = p1; P2 = p2; Deck = new TrucoDeck(gameType); }