/// <summary> /// Turns the entire list of action cards into a shuffled deck /// </summary> public void GenerateActionDeck() { do { //Generate random number to choose a card from master queue int ranNum = Random.Range(0, CardDataCompiler.Instance.MasterActionDeck.Count); //Add chosen card to queue of action deck that player draws from CurrentActionDeck.Add(CardDataCompiler.Instance.MasterActionDeck[ranNum]); //Remove added card from master queue to avoid duplicates CardDataCompiler.Instance.MasterActionDeck.RemoveAt(ranNum); } while (CardDataCompiler.Instance.MasterActionDeck.Count > 0); }
/// <summary> /// Draw cards to replenish the player's hand until it's full /// </summary> public void DrawCards() { newCards = new List <ActionCard>(); while (PlayerHand.Count < 5) { //Check if there are no futher cards if (CurrentActionDeck.Count == 0) { Debug.Log("No more action cards to draw!"); break; } //Draw a card and add it to the player hand PlayerHand.Add(CurrentActionDeck[0]); newCards.Add(CurrentActionDeck[0]); CurrentActionDeck.RemoveAt(0); } }