public void updateInfos(CPeople people){ explorationSlider.value = people.ToExploration; defenseSlider.value = people.ToDefense; buildingSlider.value = people.ToBuilding; researchSlider.value = people.ToResearch; percentLeft.text = people.effectifLeft () + "%"; }
public void updateInfos(CPeople people){ foodSlider.value = people.foodRatio * (foodSlider.maxValue / 2); waterSlider.value = people.waterRatio * (waterSlider.maxValue / 2); updateSliderColor (foodSlider); updateSliderColor (waterSlider); previsions.foodConsumption.text = ViewHelp.numberWithSign (-people.foodNeeded ()); previsions.waterConsumption.text = ViewHelp.numberWithSign (-people.waterNeeded ()); }
public void waterConsumption(CPeople people){ if (people.waterNeeded () < resources.water) { resources.water -= people.waterNeeded(); } }
public void foodConsumption(CPeople people){ if (people.foodNeeded () < resources.food) { resources.food -= people.foodNeeded(); } }
public float oToDRatioCoef = 0f; //Olds to Death public CPopulation(){ children = new CPeople (0.5f, 0.5f, 2.0f, 0.5f, 0.1f, 0.3f); adults = new CPeople (2.0f, 1.0f, 2.0f, 3.0f, 2.0f, 1.0f); olds = new CPeople (1.0f, 1.5f, 0.3f, 1.5f, 0.5f, 3.0f); }