public void SetUp(RestaurantRecipe rr) { isSetup = true; thisRecipe = rr.recipe; thisRR = rr; thisRestruant = GameController.Instance().activePlayer.restaurantClicked; costSlider.value = rr.multiplier; UpdateText(); }
public void PopulateMenuButtons(RestaurantRecipe rr) { GameObject b = Instantiate(menuButton); b.transform.parent = content; content.sizeDelta = new Vector2(content.rect.width, content.rect.height + 40); b.GetComponentInChildren <Text>().text = rr.recipe.name; b.transform.localScale = new Vector3(1, 1, 1); RecipeCost recipeCost = b.gameObject.GetComponent <RecipeCost>(); recipeCost.SetUp(rr); }
double CuttingCornersTech(RestaurantRecipe rr) { double cuttingCornerModifier = 100.00; foreach (TieredIngredient i in rr.recipe.ingredients) { if (i.tier == 0) { cuttingCornerModifier -= 0.10; } } double newMaunfacturingCost = rr.manufacturingCost * cuttingCornerModifier; return((rr.sellingPrice - newMaunfacturingCost) * rr.quantitySold); }
//This is an attempt at repopulating the menu, not so successful //called for making the button only. Not adding a recipe to the restaurant public void CreateMenuButton(RestaurantRecipe rr) { GameObject b = Instantiate(menuButton); b.transform.parent = content; content.sizeDelta = new Vector2(content.rect.width, content.rect.height + 40); Debug.Log("Name of the recipe I have right now is (Create Menu Recipe) " + rr.recipe.name); b.GetComponentInChildren <Text>().text = rr.recipe.name; b.transform.localScale = new Vector3(1, 1, 1); RecipeCost recipeCost = b.gameObject.GetComponent <RecipeCost>(); thisResturant.recipeButtons.Add(b.gameObject); //recipeCost.SetUp(thisRecipe, thisResturant); recipeCost.SetUp(thisRecipe, thisResturant); }
double SteakHouseTech(RestaurantRecipe rr) { double steakHouseModifier = 100.00; foreach (TieredIngredient i in rr.recipe.ingredients) { if (i.ingredient == RecipeIngredient.CHICKEN || i.ingredient == RecipeIngredient.PORK || i.ingredient == RecipeIngredient.BEEF || i.ingredient == RecipeIngredient.VIENNA || i.ingredient == RecipeIngredient.LOBSTER) { steakHouseModifier -= 0.05; } } double newManufacturingCost = rr.manufacturingCost * steakHouseModifier; return((rr.sellingPrice - newManufacturingCost) * rr.quantitySold); }
double FreshProduceTech(RestaurantRecipe rr) { double freshProduceModifier = 100.00; foreach (TieredIngredient i in rr.recipe.ingredients) { if (i.ingredient == RecipeIngredient.TOMATOES || i.ingredient == RecipeIngredient.GARLIC || i.ingredient == RecipeIngredient.LETTUCE || i.ingredient == RecipeIngredient.LIMES || i.ingredient == RecipeIngredient.ARTICHOKE) { freshProduceModifier -= 0.1; } } double newManufacturingCost = rr.manufacturingCost * freshProduceModifier; return((rr.sellingPrice - newManufacturingCost) * rr.quantitySold); }
public void SetUp(Recipe recipe, BuildingRestaurant building) { isSetup = true; Debug.Log("RecipeCost building = " + building.GetInstanceID()); thisRecipe = recipe; thisRestruant = building; Debug.Log("Recipe cost says that this resturANT has " + building.recipes.Count + " resturnat recipes"); for (int i = 0; i < building.recipes.Count; i++) { if (thisRecipe == building.recipes[i].recipe) { thisRR = building.recipes[i]; break; } } costSlider.value = 1; UpdateText(); Debug.Log("Restaurant from PlayerData " + GameController.Instance().activePlayer.restaurantClicked.GetInstanceID()); }
//add recipe to restaurant without the selling price detail public void AddRecipe(Recipe recipeInfo) { RestaurantRecipe current = new RestaurantRecipe(recipeInfo); recipes.Add(current); }
//add recipe to restaurant with selling price of userInputCost public void AddRecipe(double userInputCost, Recipe recipeInfo) { RestaurantRecipe current = new RestaurantRecipe(userInputCost, recipeInfo, upgrades); recipes.Add(current); }
double CheaperIngredientTech(RestaurantRecipe rr) { double newManufacturingCost = rr.manufacturingCost * 0.9; return((rr.sellingPrice - newManufacturingCost) * rr.quantitySold); }
public void Setup(RestaurantRecipe rr) { rCost.SetUp(rr); }