public StatisticsEngine () { //get our references food = (FoodResource)ResourcesManager.instance.GetResourceFood (); prisoners = (PrisonersResource)ResourcesManager.instance.GetResourcePrisoners (); population = (PopulationResource)ResourcesManager.instance.GetResourcePopulation (); happiness = (HappinessResource)ResourcesManager.instance.GetResourceHappiness (); //create blank modifiers modifiers foodModifier = new ResourceGrowthModifier (ResourceType.Food, 0); prisonersModifier = new ResourceGrowthModifier (ResourceType.Prisoners, 0); populationModifier = new ResourceGrowthModifier (ResourceType.Population, 0); happinessModifier = new ResourceGrowthModifier (ResourceType.Happiness, 0); //add these to the respective resources so that we can affect the growth rates food.ApplyModifier (foodModifier); prisoners.ApplyModifier (prisonersModifier); population.ApplyModifier (populationModifier); happiness.ApplyModifier (happinessModifier); }
void CreateResourceStore () { Resource food = new FoodResource (); Resource happiness = new HappinessResource (); Resource population = new PopulationResource (); Resource prisoners = new PrisonersResource (); mResources.Add (ResourceType.Food, food); mResources.Add (ResourceType.Happiness, happiness); mResources.Add (ResourceType.Population, population); mResources.Add (ResourceType.Prisoners, prisoners); }