public void RunFoodConfigSetup() { this.mainsList = GetFoodConfig(mainsInfoFilePath); this.toppingsList = GetFoodConfig(toppingsInfoFilePath); this.drinksList = GetFoodConfig(drinksInfoFilePath); this.burgerData = GetRestaurantConfig(burgerRestaurantPath); this.friesData = GetRestaurantConfig(friesRestaurantPath); this.foodSetupComplete = true; }
private void FillFoodDictionary() { Food newFood = null; foreach (FoodType.Type foodType in System.Enum.GetValues(typeof(FoodType.Type))) { JsonFoodContainer jsonFoodData = this.configData.GetJsonFood(foodType); JsonToFood[] jsonList = jsonFoodData.List; string foodSpritePath = jsonFoodData.SpriteLocation; foreach (JsonToFood jsonFood in jsonList) { newFood = new Food(jsonFood.name, foodType, Resources.Load <Sprite>(foodSpritePath + jsonFood.unPreppedSpriteName), Resources.Load <Sprite>(foodSpritePath + jsonFood.preppedSpriteName), Resources.Load <Sprite>(foodSpritePath + jsonFood.burntSpriteName)); this.foodDictionary.Add(jsonFood.name, newFood); } } }