Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
        public static GameShape GetGameShape(Game game)
        {
            for (int i = 0; i < gameShapes.Count; i++)
            {
                if (gameShapes[i].Game == game)
                    return gameShapes[i];
            }

            return null;
        }
Ejemplo n.º 3
0
 /// <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);
 }