Beispiel #1
0
 // Start is called before the first frame update
 public Deck(DeckEnum Type)
 {
     Cards    = new List <Card>();
     DeckType = Type;
     Dirty    = false;
     GUID     = System.Guid.NewGuid().ToString();
 }
Beispiel #2
0
 public void SetDeck(DeckEnum DeckType, Deck Deck)
 {
     for (int i = 0; i < Decks.Count; i++)
     {
         if (Decks[i].DeckType == DeckType)
         {
             Decks[i] = Deck;
         }
     }
 }
Beispiel #3
0
        /// <summary>
        /// Used to create a deck for the specified type
        /// </summary>
        /// <param name="deck">The type of deck to generate</param>
        /// <returns><see cref="CardCollection"/></returns>
        public CardCollection BuildDeck(DeckEnum deck)
        {
            switch (deck)
            {
            case DeckEnum.TurnUp:
                return(BuildNineThroughAceOfEachSuit());

            case DeckEnum.Pinochle:
                var pinochleDeck = BuildNineThroughAceOfEachSuit();
                pinochleDeck.AddRange(BuildNineThroughAceOfEachSuit());
                return(pinochleDeck);

            default:
                return(null);
            }
        }
Beispiel #4
0
    public Deck DrawDeck(DeckEnum DeckType, bool Destroy = true)
    {
        Deck temp = null;

        for (int i = 0; i < Decks.Count; i++)
        {
            if (Decks[i].DeckType == DeckType)
            {
                temp = Decks[i];
                if (Destroy)
                {
                    Decks.RemoveAt(i);
                }
            }
        }
        return(temp);
    }
Beispiel #5
0
 public Deck GetDeck(DeckEnum DeckType)
 {
     ref List <Card> deck = ref Decks[0].Cards;