// 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(); }
public void SetDeck(DeckEnum DeckType, Deck Deck) { for (int i = 0; i < Decks.Count; i++) { if (Decks[i].DeckType == DeckType) { Decks[i] = Deck; } } }
/// <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); } }
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); }
public Deck GetDeck(DeckEnum DeckType) { ref List <Card> deck = ref Decks[0].Cards;