private void Draw() { SetPhase(Phase.Draw); // First, discard all current hand foreach (Card card in m_hand) { // TODO: Discard delegate called here // Add to discard pile m_discard.AddCard(card); } m_hand.Clear(); // Draw the maximum amount of cards // TODO: Clean this up int currentHandPosition = 0; int toDraw = m_handSize; while (toDraw > 0) { // If the draw pile is empty, then shuffle the discard pile inside of it if (m_draw.IsEmpty()) { m_discard.Shuffle(); m_draw.AddCardStack(m_discard); } // Take the top of the draw pile and add it to the next hand Card topDrawCard = m_draw.RemoveTop(); topDrawCard.transform.SetParent(m_handBones[currentHandPosition], false); m_hand.Add(topDrawCard); currentHandPosition++; toDraw--; } EnterMainPhase(); }