Esempio n. 1
0
 public void SetUp(RestaurantRecipe rr)
 {
     isSetup          = true;
     thisRecipe       = rr.recipe;
     thisRR           = rr;
     thisRestruant    = GameController.Instance().activePlayer.restaurantClicked;
     costSlider.value = rr.multiplier;
     UpdateText();
 }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
    //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);
    }
Esempio n. 5
0
    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);
    }
Esempio n. 6
0
    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);
    }
Esempio n. 7
0
    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());
    }
Esempio n. 8
0
    //add recipe to restaurant without the selling price detail
    public void AddRecipe(Recipe recipeInfo)
    {
        RestaurantRecipe current = new RestaurantRecipe(recipeInfo);

        recipes.Add(current);
    }
Esempio n. 9
0
    //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);
    }
Esempio n. 10
0
    double CheaperIngredientTech(RestaurantRecipe rr)
    {
        double newManufacturingCost = rr.manufacturingCost * 0.9;

        return((rr.sellingPrice - newManufacturingCost) * rr.quantitySold);
    }
Esempio n. 11
0
 public void Setup(RestaurantRecipe rr)
 {
     rCost.SetUp(rr);
 }