Exemplo n.º 1
0
        public void TestDiscountService1(int quantity, int discount)
        {
            var item        = new Cookware();
            var shopService = new ShopService();

            var shoppingCart = shopService.Sell(item, quantity);

            shoppingCart.PurchaseDiscount.Should().Be(discount);
        }
Exemplo n.º 2
0
    public void AddFood(GameObject _food)
    {
        Cookware curCookware = LevelManager.cookware[PlayerController.position];
        int      foodSlot    = curCookware.GetEmptyFoodSlot();

        curCookware.food[foodSlot] = Instantiate(_food, curCookware.foodSlots[foodSlot]).GetComponent <Food>();
        if (curCookware.GetNumberOfFoodSlotsTaken() == 1)
        {
            curCookware.cook = curCookware.StartCoroutine(curCookware.Cook());
        }
        if (curCookware.GetEmptyFoodSlot() == -1)
        {
            addFood.gameObject.SetActive(false);
        }
    }
Exemplo n.º 3
0
    public void PlateFood()
    {
        Cookware curCookware = LevelManager.cookware[PlayerController.position];

        Destroy(curCookware.MostCriticalFood().gameObject);
        addFood.gameObject.SetActive(true);
        Food mostCritical = curCookware.MostCriticalFood();

        if (mostCritical == null)
        {
            plateFood.gameObject.SetActive(false);
            curCookware.StopCoroutine(curCookware.cook);
            return;
        }
        if (mostCritical.isReadyToPlate)
        {
            plateFood.gameObject.SetActive(false);
        }
    }