private IEnumerator resetRound() { if (PerceptorEvaluator != null && PerceptorEvaluator.isActiveAndEnabled) { yield return(new WaitUntil(() => PerceptorEvaluator.READY)); } // Reset all cards from the discard back into the deck foreach (CardController cc in DiscardPile.GetComponentsInChildren <CardController>()) { cc.MoveTo(Deck.transform); } // Reset all players foreach (PlayerController p in Players) { p.Reset(); } // Reset the discard pile counters (the deck is reset when Shuffle() is called during STAGE_INITIAL) DiscardPile.Reset(); TurnHistory.Clear(); // Display play statistics, if any if (PosterioriPerceptor.StatisticOfPlay != null) { AIUtil.DisplayMatrix("Statistics of play", PosterioriPerceptor.StatisticOfPlay); } // Wait untill all cards are back in the deck before reseting the overall game state yield return(new WaitUntil(() => (AllCardsDown))); CurrentStage = STAGE_INITIAL; }