Example #1
0
    public void SetData(CityPart cityPart)
    {
        displayedCityPart = cityPart;

        totalCitizens.text = SocietyDataInterface.GetCitizensCount(displayedCityPart.CityPlace).ToString();

        lowClass.text    = SocietyDataInterface.GetCitizensEconomicClassCount(displayedCityPart.CityPlace, Citizen.ECONOMIC_CLASS.LOW).ToString();
        middleClass.text = SocietyDataInterface.GetCitizensEconomicClassCount(displayedCityPart.CityPlace, Citizen.ECONOMIC_CLASS.MIDDLE).ToString();
        highClass.text   = SocietyDataInterface.GetCitizensEconomicClassCount(displayedCityPart.CityPlace, Citizen.ECONOMIC_CLASS.HIGH).ToString();

        noneEnviromentalCommitment.text = SocietyDataInterface.GetCitizensEnviomentalCommitmentCount(displayedCityPart.CityPlace, Citizen.ENVIROMENTAL_COMMITMENT.NONE).ToString();
        someEnviromentalCommitment.text = SocietyDataInterface.GetCitizensEnviomentalCommitmentCount(displayedCityPart.CityPlace, Citizen.ENVIROMENTAL_COMMITMENT.SOME).ToString();
        fullEnviromentalCommitment.text = SocietyDataInterface.GetCitizensEnviomentalCommitmentCount(displayedCityPart.CityPlace, Citizen.ENVIROMENTAL_COMMITMENT.FULL).ToString();

        activeNature.text  = SocietyDataInterface.GetCitizensNatureCount(displayedCityPart.CityPlace, Citizen.NATURE.ACTIVE).ToString();
        calmNature.text    = SocietyDataInterface.GetCitizensNatureCount(displayedCityPart.CityPlace, Citizen.NATURE.CALM).ToString();
        socialNature.text  = SocietyDataInterface.GetCitizensNatureCount(displayedCityPart.CityPlace, Citizen.NATURE.SOCIAL).ToString();
        dreamerNature.text = SocietyDataInterface.GetCitizensNatureCount(displayedCityPart.CityPlace, Citizen.NATURE.DREAMER).ToString();

        calmedTimeManagement.text = SocietyDataInterface.GetCitizensTimeManagementCount(displayedCityPart.CityPlace, Citizen.TIME_MANAGEMENT.CALMED).ToString();
        normalTimeManagement.text = SocietyDataInterface.GetCitizensTimeManagementCount(displayedCityPart.CityPlace, Citizen.TIME_MANAGEMENT.NORMAL).ToString();
        rushedTimeManagement.text = SocietyDataInterface.GetCitizensTimeManagementCount(displayedCityPart.CityPlace, Citizen.TIME_MANAGEMENT.RUSHED).ToString();

        stingyMoneyManagement.text      = SocietyDataInterface.GetCitizensMoneyManagementCount(displayedCityPart.CityPlace, Citizen.MONEY_MANAGEMENT.STINGY).ToString();
        responsibleMoneyManagement.text = SocietyDataInterface.GetCitizensMoneyManagementCount(displayedCityPart.CityPlace, Citizen.MONEY_MANAGEMENT.RESPONSIBLE).ToString();
        wastefulMoneyManagement.text    = SocietyDataInterface.GetCitizensMoneyManagementCount(displayedCityPart.CityPlace, Citizen.MONEY_MANAGEMENT.WASTEFUL).ToString();

        globalhealth.GetComponent <IndexBarController>().IndexID          = displayedCityPart.GlobalHealth.ID;
        globalHappiness.GetComponent <IndexBarController>().IndexID       = displayedCityPart.GlobalHappiness.ID;
        lowClassProportion.GetComponent <IndexBarController>().IndexID    = displayedCityPart.LowClassProportion.ID;
        middleClassProportion.GetComponent <IndexBarController>().IndexID = displayedCityPart.MiddleClassProportion.ID;
        highClassProportion.GetComponent <IndexBarController>().IndexID   = displayedCityPart.HighClassProportion.ID;
    }
Example #2
0
 public void OnDurationValueChange(int newValue)
 {
     if (initiallized++ > 2)
     {
         if (newValue != duration.value)
         {
             Debug.Log("You have not changed the dropdown value");
             return;
         }
         Debug.Log("Duration value changed");
         SocietyDataInterface.AddIndustryContractsDurationChange(displayedJob.CityPlace, displayedJob.JobType, (Job.DURATION)newValue);
     }
 }
Example #3
0
 public void OnExtensioValueChange(int newValue)
 {
     if (initiallized++ > 2)
     {
         if (newValue == extension.value)
         {
             Debug.Log("You have not changed the dropdown value");
             return;
         }
         SocietyDataInterface.AddIndustryExtensionChange(displayedJob.CityPlace, displayedJob.JobType, (Job.EXTENSION)newValue);
         Debug.Log("Extension value changed");
     }
 }
Example #4
0
 public void OnTimeDemandValueChange(int newValue)
 {
     if (initiallized++ > 2)
     {
         if (newValue != timeDemand.value)
         {
             Debug.Log("You have not changed the dropdown value");
             return;
         }
         SocietyDataInterface.AddIndustryTimeDemandChange(displayedJob.CityPlace, displayedJob.JobType, (Job.TIME_DEMAND)newValue);
         Debug.Log("Time demand value changed");
     }
 }
Example #5
0
 public void OnAvailabilityValueChange(int newValue)
 {
     if (initiallized++ > 0)
     {
         if (newValue != availability.value)
         {
             Debug.Log("You have not changed the dropdown value");
             return;
         }
         Debug.Log("Availability value changed");
         SocietyDataInterface.AddLeisureAvailabilityStateChange(displayedLeisure.CityPlace, displayedLeisure.LeisurePlace, (Leisure.AVAILABILITY)newValue);
     }
 }
 public void OnEnhancementsValueChange(int newValue)
 {
     if (initiallized++ > 1)
     {
         if (newValue != enhancements.value)
         {
             Debug.Log("You have not changed the dropdown value");
             return;
         }
         Debug.Log("Enhancements value changed");
         SocietyDataInterface.AddTransportEnhancementsChange(displayedTransport.CityPlace, displayedTransport.TransportType, (Transport.ENHANCEMENTS)newValue);
     }
     else
     {
         initiallized++;
     }
 }
 public void OnExpansionsValueChange(int newValue)
 {
     if (initiallized++ > 1)
     {
         if (newValue != expansions.value)
         {
             Debug.Log("You have not changed the dropdown value");
             return;
         }
         Debug.Log("Expansion value changed");
         SocietyDataInterface.AddTransportExpansionsChange(displayedTransport.CityPlace, displayedTransport.TransportType, (Transport.EXPANSION)newValue);
     }
     else
     {
         initiallized++;
     }
 }
    // Start is called before the first frame update
    public void SetData(Transport transport)
    {
        initiallized       = 0;
        displayedTransport = transport;
        transportType.text = transport.TransportType.ToString();

        capacity.text   = SocietyDataInterface.GetTransportCapacity(transport.CityPlace, transport.TransportType).ToString();
        baseSpeed.text  = SocietyDataInterface.GetTransportBaseSpeed(transport.CityPlace, transport.TransportType).ToString();
        speed.text      = SocietyDataInterface.GetTransportSpeed(transport.CityPlace, transport.TransportType).ToString();
        freeSpaces.text = SocietyDataInterface.GetTransportSectorFreeSpaces(transport.CityPlace, transport.TransportType).ToString();

        expansions.ClearOptions();
        List <TMP_Dropdown.OptionData> options = new List <TMP_Dropdown.OptionData>();

        foreach (var e in Enum.GetNames(typeof(Transport.EXPANSION)))
        {
            options.Add(new TMP_Dropdown.OptionData()
            {
                text = e
            });
        }
        expansions.AddOptions(options);
        expansions.value = (int)SocietyDataInterface.GetTransportExpansions(transport.CityPlace, transport.TransportType);

        enhancements.ClearOptions();
        options = new List <TMP_Dropdown.OptionData>();
        foreach (var e in Enum.GetNames(typeof(Transport.ENHANCEMENTS)))
        {
            options.Add(new TMP_Dropdown.OptionData()
            {
                text = e
            });
        }
        enhancements.AddOptions(options);
        enhancements.value = (int)SocietyDataInterface.GetTransportEnhancements(transport.CityPlace, transport.TransportType);

        indexBarSpeed.GetComponent <IndexBarController>().IndexID     = transport.SpeedIndex.ID;
        indexBarWear.GetComponent <IndexBarController>().IndexID      = transport.Wear.ID;
        indexBarPollution.GetComponent <IndexBarController>().IndexID = transport.Polluting.ID;
    }
 public void SetData()
 {
     globalHappiness.GetComponent <IndexBarController>().IndexID   = new RepresentativeIndex("Felicidad Global", "Felicidad global de la sociedad", SocietyDataInterface.GetGlobalHappinessValue()).ID;
     globalHealth.GetComponent <IndexBarController>().IndexID      = new RepresentativeIndex("Salud Global", "Salud global de la sociedad", SocietyDataInterface.GetGlobalHappinessValue()).ID;
     globalPollution.GetComponent <IndexBarController>().IndexID   = new RepresentativeIndex("Contaminación Global", "Contaminación global de la sociedad", SocietyDataInterface.GetGlobalHappinessValue()).ID;
     globalAlcaldoLove.GetComponent <IndexBarController>().IndexID = new RepresentativeIndex("Amor Global", "Amor global al alcaldo en la sociedad", SocietyDataInterface.GetGlobalHappinessValue()).ID;
 }