Esempio n. 1
0
 public void CheckIfFinishedOrReadyForAutoComplete()
 {
     if (DiscardPile.AllAreFull())
     {
         OnGameEnd();
     }
     else if (openDrawPile.Cards.Count == 0 && closedDrawPile.Cards.Count == 0 && MainPile.AllAreRevealedCompletely())
     {
         MouseDragManager.draggingEnabled = false;
         StartCoroutine(AutoComplete());
     }
 }
Esempio n. 2
0
    private IEnumerator AutoComplete()
    {
        IsAutoCompleting = true;
        WaitForSeconds wait = new WaitForSeconds(0.2f);

        while (!DiscardPile.AllAreFull())
        {
            DiscardPile smallestDiscardPile = DiscardPile.GetSmallest(out Card cardToAdd);
            cardToAdd.Move(smallestDiscardPile, false, false, true);
            yield return(wait);
        }

        IsAutoCompleting = false;
        OnGameEnd();
    }