Esempio n. 1
0
    public IEnumerator infectionPhase()
    {
        for (int i = 0; i < infectionRateTrack[infectionRateTrackIndex]; i++)
        {
            InfectionCard drawn = infectionDeck.Pop();
            Debug.Log("Infection: " + drawn.getName());
            Location loc = drawn.getLocation();
            infectionDiscardPile.Add(drawn);
            yield return(StartCoroutine(cardUI.infectionDraw(drawn.getName(), loc.getColour())));

            if (diseaseStatus[(int)loc.getColour()] < Vals.DISEASE_ERADICATED)
            {
                yield return(StartCoroutine(addCube(loc, loc.getColour())));
            }
            outbreakCitiesThisMove.Clear();
        }
    }
Esempio n. 2
0
    public IEnumerator infectCities()
    {
        for (int i = Vals.INITIAL_INFECTION_ROUNDS; i > 0; i--)
        {
            for (int j = 0; j < Vals.CARDS_PER_INITIAL_INFECTION_ROUND; j++)
            {
                InfectionCard drawn = infectionDeck.Pop();
                Location      loc   = drawn.getLocation();
                infectionDiscardPile.Add(drawn);
                yield return(StartCoroutine(cardUI.infectionDraw(drawn.getName(), loc.getColour())));

                Debug.Log("Initial infection in " + drawn.getName());
                for (int k = 0; k < i; k++)
                {
                    yield return(StartCoroutine(addCube(loc, loc.getColour())));
                }
            }
        }
    }
    public GameData(Game game)
    {
        challenge             = game.getChallenge();
        currentGamePhase      = game.getCurrentPhase();
        currentPlayerRoleKind = game.getCurrentPlayer().getRoleKind();
        infectionRateIndex    = game.getInfectionIndex();
        outBreakRate          = game.getOutbreakRate();
        remainingResearch     = game.getRemainingResearch();
        seed = game.seed;
        BioTerroristVolunteer = game.BioTerroristVolunteer;
        currentPlayerIndex    = game.currentPlayerIndex;

        difficulity = game.nEpidemicCard;

        playerCardDeck       = game.getPlayerCardDeckString();
        playerDiscardPile    = game.getPlayerDiscardPileString();
        infectionCardDeck    = game.getInfectionDeckString();
        infectionDiscardPile = game.getInfectionDiscardPileString();
        allHandCards         = game.getAllHandCards();
        EpidemicCardIntList  = EpidemicCard.getEpidemicCard().getIntList();
        foreach (City city in game.getCities())
        {
            CityInfo cityInfo = new CityInfo(city);
            CityInfoList.Add(cityInfo);
        }

        foreach (KeyValuePair <Color, Disease> entry in game.getDiseases())
        {
            diseaseInfoList.Add(new DiseaseInfo(entry.Value));
        }

        foreach (Player player in game.getPlayers())
        {
            PlayerCardList playerHand = new PlayerCardList();
            mobileHospitalActivated.Add(player.getMobileHospitalActivated());
            if (player.getRoleKind() == RoleKind.ContingencyPlanner && player.getEventCardOnTopOfRoleCard() != null)
            {
                eventCardOnTopOfRoleCard = player.getEventCardOnTopOfRoleCard().getName();
            }
            if (player.getRoleKind() == RoleKind.FieldOperative)
            {
                FOcubes = player.getAllCubes();
            }
            hasCommercialTravelBanInfrontOfPlayer.Add(player.hasEventCardInFront());
            //CommercialTravelBanTurn.Add (player.getCommercialTravelBanTurn());
            roleKindList.Add(player.getRoleKind());
            foreach (PlayerCard pc in player.getHand())
            {
                if (pc.getType().Equals(CardType.CityCard))
                {
                    CityCard cityCard = (CityCard)pc;
                    playerHand.playerHand.Add(cityCard.getName());
                    //Debug.Log ("City Card: " + cityCard.getName());
                }
                else if (pc.getType().Equals(CardType.EventCard))
                {
                    EventCard eventCard = (EventCard)pc;
                    playerHand.playerHand.Add(eventCard.getName());
                    //Debug.Log ("Event Card: " + eventCard.getEventKind());
                }
                else
                {
                    InfectionCard infectionCard = (InfectionCard)pc;
                    playerHand.playerHand.Add((infectionCard.getName()));
                    //Debug.Log ("Event Card: " + infectionCard.getName());
                }
            }
            playerCardList.Add(playerHand);
        }
    }