/// <summary> /// Initializes a new instance of the <see cref="Deck"/> class. /// </summary> /// <param name="numberOfDecks">The number of decks.</param> /// <param name="uptoNumber">The upto number.</param> /// <param name="game">The game.</param> public Deck(int numberOfDecks, int uptoNumber, Game game) : this(game) { for (int deck = 0; deck < numberOfDecks; deck++) { for (int suit = 1; suit <= 4; suit++) { for (int number = 1; number <= uptoNumber; number++) { Cards.Add(new Card(number, (CardSuit)suit, this)); } } } Shuffle(); }
public static GameShape GetGameShape(Game game) { for (int i = 0; i < gameShapes.Count; i++) { if (gameShapes[i].Game == game) return gameShapes[i]; } return null; }
/// <summary> /// Initializes a new instance of the <see cref="Deck"/> class. /// </summary> /// <param name="game">The game.</param> public Deck(Game game) { this._game = game; this._game.Decks.Add(this); }