Пример #1
0
    public IEnumerator handleEventCardClick(PlayerCard card)
    {
        overlayUI.StopAllCoroutines();
        overlayUI.deactivateInteractableOverlay();
        switch (card.getId())
        {
        case Vals.ONE_QUIET_NIGHT:
            if (Vals.oneQuietNightActive)
            {
                yield break;
            }
            Debug.Log("Playing One Quiet Night");
            Vals.oneQuietNightActive = true;
            break;

        case Vals.AIRLIFT:
            Debug.Log("Playing Airlift");
            string message = "Select player to Airlift then select destination";
            yield return(StartCoroutine(overlayUI.requestSimpleSelectionFromPlayer(playerManager.getPlayers(), Vals.SELECTABLE_PLAYER, message)));

            Vals.cardResolving = Vals.AIRLIFT;
            break;

        case Vals.RESILIENT_POPULATION:
            Debug.Log("Playing Resilient Population");
            if (board.getInfectionDiscardPile().Count > 0)
            {
                yield return(StartCoroutine(resilientPopulation()));
            }
            break;

        case Vals.FORECAST:
            Debug.Log("Playing Forecast");
            yield return(StartCoroutine(forecast()));

            break;

        case Vals.GOVERNMENT_GRANT:
            Debug.Log("Playing Government Grant");
            Vals.cardResolving = Vals.GOVERNMENT_GRANT;
            break;
        }
        board.eventCardPlayed(card);
        yield break;
    }