コード例 #1
0
 /// <summary>
 /// Creates a custom set of cards
 /// </summary>
 /// <param name="cards_">custom set of cards</param>
 /// <param name="cardsexpandable_">If the cards are to be displayed lower than the next one up</param>
 /// <param name="stackType_">Type of stack this set is</param>
 public Set(List <Card> cards_, int gridRow_, int gridCol_, bool cardsexpandable_ = false, int maxCardExpandable_ = 0, GameRules.StackType stackType_ = GameRules.StackType.undefined)
 {
     cards             = cards_;
     cardsExpanded     = cardsexpandable_;
     maxCardExpandable = maxCardExpandable_;
     stackType         = stackType_;
     gridCol           = gridCol_;
     gridRow           = gridRow_;
 }
コード例 #2
0
 /// <summary>
 /// Creates a number of decks of 52 cards
 /// </summary>
 /// <param name="cardsexpandable_">If the cards are to be displayed lower than the next one up</param>
 /// <param name="numDecks">How many full 52 cards to create</param>
 /// <param name="stackType_">Type of stack this set is</param>
 public Set(int gridRow_, int gridCol_, int numDecks = 1, bool cardsexpandable_ = false, int maxCardExpandable_ = 0, GameRules.StackType stackType_ = GameRules.StackType.undefined)
 {
     cards.Clear();
     cardsExpanded     = cardsexpandable_;
     maxCardExpandable = maxCardExpandable_;
     stackType         = stackType_;
     gridCol           = gridCol_;
     gridRow           = gridRow_;
     for (int i = 0; i < numDecks; i++)
     {
         for (int s = 0; s < 4; s++)
         {
             for (int r = 0; r < 13; r++)
             {
                 cards.Add(new Card(r, s, gridCol, gridRow, true));
             }
         }
     }
 }