private void FillThemeSpriteDictionary(JsonToRestaurant restaurantData) { this.themeSpriteDictionary = new Dictionary <string, Sprite>(); foreach (JsonSpritesObject spritePair in restaurantData.RestaurantThemeSprites) { this.themeSpriteDictionary.Add(spritePair.Name, Resources.Load <Sprite>(this.restaurantSpritePath + spritePair.SpriteName)); } }
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 MealDrawerSetup(JsonToRestaurant restaurantData) { this.mealDrawerData = new Dictionary <string, Sprite>(); foreach (JsonSpritesObject displayObj in restaurantData.FoodDisplaySprites) { this.mealDrawerData.Add(displayObj.Name, Resources.Load <Sprite>(this.restaurantSpritePath + displayObj.SpriteName)); } // add drinks as they re-use sprites from the menu foreach (KeyValuePair <string, Food> entry in this.foodDictionary) { // do something with entry.Value or entry.Key if (entry.Value.GetFoodType() == FoodType.Type.drink) { this.mealDrawerData.Add(entry.Key, entry.Value.GetPreppedSprite()); } } }
public void BuildRestaurant(RestaurantInfo.Types type, int daysPassed) { if (type == RestaurantInfo.Types.NoType) { throw new System.Exception("Can't build restaurant of type NoType"); } else if (type != this.currentRestaurantType) { // new restaurant setup this.currentRestaurantType = type; JsonToRestaurant restaurantData = configData.GetRestaurantData(this.currentRestaurantType); this.restaurantMenu = restaurantData.Menu; this.restaurantSpritePath = restaurantData.SpriteLocation; this.FillThemeSpriteDictionary(restaurantData); this.mealDrawerSetupComplete = false; this.MealDrawerSetup(restaurantData); this.mealDrawerSetupComplete = true; } this.BuildNewMenu(daysPassed); }