예제 #1
0
파일: Deck.cs 프로젝트: elusive/Whistle
        /// <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();
        }
예제 #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;
        }
예제 #3
0
파일: Deck.cs 프로젝트: elusive/Whistle
 /// <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);
 }