Exemplo n.º 1
0
        private Bowl GetBowl()
        {
            Bowl result = new Bowl();

            // ...
            return(result);
        }
Exemplo n.º 2
0
    public void OnInsertItem(ItemSlot slot)
    {
        if (slot == this.m_WoodSlot)
        {
            this.m_BurningDuration -= slot.m_Item.m_Info.m_AddFirecamBurningTime;
            if (this.m_BurningDuration < 0f)
            {
                this.m_BurningDuration = 0f;
            }
            UnityEngine.Object.Destroy(slot.m_Item.gameObject);
            return;
        }
        bool flag = false;

        for (int i = 0; i < this.m_CookingSlots.Length; i++)
        {
            if (slot == this.m_CookingSlots[i])
            {
                flag = true;
                break;
            }
        }
        if (flag && slot.m_Item.m_Info.m_Type == ItemType.Bowl)
        {
            Collider component = slot.m_Item.gameObject.GetComponent <Collider>();
            component.isTrigger = true;
            slot.Deactivate();
            Bowl bowl = (Bowl)slot.m_Item;
            bowl.OnFirecampAdd(this);
        }
    }
Exemplo n.º 3
0
        public void Cook(IVegetable firstVegetable, IVegetable secondVegetable, Bowl bowl)
        {
            var areIngridientsAvaliable = (firstVegetable != null) && (secondVegetable != null) && (bowl != null);

            if (!areIngridientsAvaliable)
            {
                this.speachLogger.Say("Oops, something went wrong with the ingridients, lets try again!");
                return;
            }

            this.PrepareVegetables(firstVegetable, secondVegetable);

            // Task 2
            var isPreparationComplete = this.CheckIfVegetableIsReadyToCook(firstVegetable) &&
                                        this.CheckIfVegetableIsReadyToCook(secondVegetable);

            if (isPreparationComplete)
            {
                bowl.Contents.Add(secondVegetable);
                bowl.Contents.Add(firstVegetable);

                this.speachLogger.Say("Awesome we got ourselves vegetables in a bowl!");
            }
            else
            {
                this.speachLogger.Say("Oops, I messed up the preparation of the products..");
            }
        }
Exemplo n.º 4
0
 public void Cook(Vegetable vegetable)
 {
     Peel(vegetable);
     Cut(vegetable);
     bowl = GetBowl();
     bowl.Add(vegetable);
 }
Exemplo n.º 5
0
        public ActionResult FileUpload(ImageGallery IG)
        {
            // Apply Validation Here


            if (IG.File.ContentLength > (2 * 1024 * 1024))
            {
                ModelState.AddModelError("CustomError", "File size must be less than 2 MB");
                return(View());
            }
            if (IG.File.ContentType != "image/jpeg")
            {
                ModelState.AddModelError("CustomError", "File type allowed : jpeg");
                return(View());
            }

            IG.FileName  = IG.File.FileName;
            IG.ImageSize = IG.File.ContentLength;

            Bowl bowl = db.Bowls.Find(IG.Id);

            bowl.Picture = new byte[IG.File.ContentLength];
            IG.File.InputStream.Read(bowl.Picture, 0, IG.File.ContentLength);
            var last = IG.FileName.LastIndexOfAny(new char[] { '\\' });

            bowl.FileName = IG.FileName.Substring(last + 1);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 6
0
        private Bowl GetBowl()
        {
            Bowl result = new Bowl();

            // ...
            return result;
        }
Exemplo n.º 7
0
 public void OnRemoveItem(ItemSlot slot)
 {
     if (slot && !slot.m_IsBeingDestroyed)
     {
         slot.gameObject.SetActive(true);
     }
     if (slot.m_Item == null)
     {
         return;
     }
     if (slot.m_Item.m_Info.m_ID == ItemID.Bamboo_Bowl)
     {
         for (int i = 0; i < this.m_Slots.Count; i++)
         {
             this.m_Slots[i].m_ActivityUpdate = true;
             this.m_Slots[i].Activate();
         }
     }
     if (slot.m_Item.m_Info.m_Type == ItemType.Bowl)
     {
         Bowl bowl = (Bowl)slot.m_Item;
         bowl.OnFirecampRemove(this.m_Firecamp);
         this.m_Bowls.Remove(bowl);
     }
 }
Exemplo n.º 8
0
    public void SwapBowl()
    {
        currentBowl = GameObject.FindGameObjectWithTag("Bowl").GetComponent <Bowl>();

        temp2.SetProgress(currentBowl);
        temp2.SetType(currentBowl);

        currentBowl.SetProgress(temp);
        currentBowl.SetType(temp);

        temp.SetProgress(temp2);
        temp.SetType(temp2);

        sprite = GetGameObjectSprite(currentBowl.gameObject);
        color  = GetGameObjectColor(currentBowl.gameObject);

        currentBowl.gameObject.GetComponent <SpriteRenderer>().sprite = bowlSprite;
        currentBowl.gameObject.GetComponent <SpriteRenderer>().color  = bowlColor;

        bowlSprite = sprite;
        bowlColor  = color;

        ChangeAppereance();

        LevelManager.instance.SetProgress();
    }
Exemplo n.º 9
0
    public void UnregisterBowl(Bowl bowl)
    {
        BowlIconData bowlIconData = this.m_Datas[bowl];

        UnityEngine.Object.Destroy(bowlIconData.obj);
        this.m_Datas.Remove(bowl);
    }
Exemplo n.º 10
0
    public void Cook()
    {
        Vegetable potato = GetVegetable(VegetableType.Potato);

        Peel(potato);
        Cut(potato);

        Vegetable carrot = GetVegetable(VegetableType.Carrot);

        Peel(carrot);
        Cut(carrot);

        Bowl bowl = GetBowl();

        bowl.Add(carrot);
        bowl.Add(potato);

        var sb = new StringBuilder();

        sb.Append("Bowl with ");
        foreach (var vegetable in bowl.Vegetables)
        {
            sb.Append($"{vegetable.Type.ToString().ToLower()} + ");
        }

        sb.Remove(sb.Length - 3, 3);
        sb.Append(" is now prepared!");
        Console.WriteLine(sb.ToString());
    }
Exemplo n.º 11
0
        public void should_valid_when_create_invalid_10th_frame_pinhit_less_than_Max_point()
        {
            Bowl          b2    = new Bowl(10);
            Bowl          b3    = new Bowl(10);
            AbstractFrame frame = new LastFrame(strike, b2, b3, 2);

            Assert.IsTrue(frame.IsValid);
        }
Exemplo n.º 12
0
        public void should_valid_when_create_invalid_frame_pinhit_less_than_Max_point()
        {
            Bowl  b1    = new Bowl(4);
            Bowl  b2    = new Bowl(6);
            Frame frame = new Frame(b1, b2, 2);

            Assert.IsTrue(frame.IsValid);
        }
Exemplo n.º 13
0
        public void should_invalid_when_create_invalid_frame_pinhit_more_than_Max_point()
        {
            Bowl  b1    = new Bowl(8);
            Bowl  b2    = new Bowl(8);
            Frame frame = new Frame(b1, b2, 2);

            Assert.IsFalse(frame.IsValid);
        }
Exemplo n.º 14
0
 public DinnerWareSet(string sku, decimal price, string promoNote, Bowl bowl1, Plate plate1)
 {
     Sku       = sku;
     Price     = price;
     PromoNote = promoNote;
     Bowl1     = bowl1;
     Plate1    = plate1;
 }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            Bowl          myBowl          = new Bowl("DEF456", "2019HolidayRed");
            Plate         myPlate         = new Plate("ABC123", "2019HolidayRed");
            DinnerWareSet myDinnerWareSet = new DinnerWareSet("2019DWSet", 79.99m, "Limited Edition Holiday 2019 Promo", myBowl, myPlate);

            Console.WriteLine(myDinnerWareSet);
        }
Exemplo n.º 16
0
        public Bowl Cook(Vegetable vegetable)
        {
            Bowl bowl = this.GetBowl();

            bowl.Add(vegetable);

            return(bowl);
        }
Exemplo n.º 17
0
        public ActionResult DeleteConfirmed(int id)
        {
            Bowl bowl = db.Bowls.Find(id);

            db.Bowls.Remove(bowl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 18
0
        public IContainable GetBowl()
        {
            var bowl = new Bowl();

            this.speachLogger.Say("We have a bowl now!");

            return(bowl);
        }
Exemplo n.º 19
0
        public void Arrange()
        {
            _frameFactory = new FrameFactory();
            bowl1         = new Bowl(7);
            bowl2         = new Bowl(3);

            //10th Frame Bowl
            strike = new Bowl(10);
        }
Exemplo n.º 20
0
    public void RegisterBowl(Bowl bowl)
    {
        BowlIconData bowlIconData = new BowlIconData();

        bowlIconData.obj          = UnityEngine.Object.Instantiate <GameObject>(this.m_IconPrefab, base.transform);
        bowlIconData.canvas_group = bowlIconData.obj.GetComponent <CanvasGroup>();
        bowlIconData.icon         = bowlIconData.obj.transform.Find("Icon").gameObject.GetComponent <RawImage>();
        bowlIconData.mask         = bowlIconData.obj.transform.Find("Mask").gameObject.GetComponent <Image>();
        this.m_Datas[bowl]        = bowlIconData;
    }
    static void Main()
    {
        var ser = new XmlSerializer(typeof(Bowl));
        var obj = new Bowl {
            Fruits = new List <Fruit> {
                new Apple(), new Banana()
            }
        };

        ser.Serialize(Console.Out, obj);
    }
Exemplo n.º 22
0
 public void OnRemoveItem(ItemSlot slot)
 {
     if (slot.m_Item && slot.m_Item.m_Info.m_Type == ItemType.Bowl)
     {
         if (!slot.m_IsBeingDestroyed)
         {
             slot.gameObject.SetActive(true);
         }
         Bowl bowl = (Bowl)slot.m_Item;
         bowl.OnFirecampRemove(this);
     }
 }
Exemplo n.º 23
0
    public void Cook(Vegetable vegetable)
    {
        vegetable = this.GetVegetable();

        this.Peel(vegetable);

        this.Cut(vegetable);

        Bowl bowl = this.GetBowl();

        bowl.BowlList.Add(vegetable);
    }
Exemplo n.º 24
0
 public ActionResult Edit([Bind(Include = "Id,Picture,FileName,BowlSizeId,BiasId,WeightId,InLocker,OwnerName,Comment")] Bowl bowl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bowl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BiasId     = new SelectList(db.Biases, "Id", "BiasSize", bowl.BiasId);
     ViewBag.BowlSizeId = new SelectList(db.Bowlsizes, "Id", "Size", bowl.BowlSizeId);
     ViewBag.WeightId   = new SelectList(db.Weights, "Id", "BowlWeight", bowl.WeightId);
     return(View(bowl));
 }
Exemplo n.º 25
0
 public void OnInsertItem(ItemSlot slot)
 {
     if (slot.m_Item.m_Info.IsBowl())
     {
         BowlInfo bowlInfo = (BowlInfo)slot.m_Item.m_Info;
         if (bowlInfo.m_LiquidType != LiquidType.Water)
         {
             Bowl bowl = (Bowl)slot.m_Item;
             bowl.Spill(-1f);
             bowlInfo.m_LiquidType = LiquidType.Water;
         }
     }
 }
Exemplo n.º 26
0
        public void Cook()
        {
            Potato potato = GetPotato();
            Carrot carrot = GetCarrot();
            Bowl   bowl   = GetBowl();

            Peel(potato);
            Peel(carrot);
            Cut(potato);
            Cut(carrot);
            bowl.Add(carrot);
            bowl.Add(potato);
        }
Exemplo n.º 27
0
        public void Main()
        {
            Potato potato = new Potato();
            Carrot carrot = new Carrot();
            Peel(potato);
            Peel(carrot);
            Cut(potato);
            Cut(carrot);

            Bowl bowl = new Bowl();
            bowl.Add(carrot);
            bowl.Add(potato);
        }
Exemplo n.º 28
0
    public void InitBowl(Bowl bowl)
    {
        if (Player.changeNeeded == 0 && trocaCollected > 0)
        {
            rb.constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotation;

            PlayerController.currState = PlayerController.State.FILLING_BOWL;
        }
        else
        {
            PlayerController.currState = PlayerController.State.NONE;
        }
    }
Exemplo n.º 29
0
    public void Cook()
    {
        Bowl bowl = GetBowl();

        Potato potato = GetPotato();

        ProcessVegetable(potato);
        bowl.Add(potato);

        Carrot carrot = GetCarrot();

        ProcessVegetable(carrot);
        bowl.Add(carrot);
    }
Exemplo n.º 30
0
        public void Cook()
        {
            Potato potato = this.GetPotato();
            Carrot carrot = this.GetCarrot();

            this.Peel(potato);
            this.Peel(carrot);
            this.Cut(potato);
            this.Cut(carrot);
            Bowl bowl = this.GetBowl();

            bowl.Add(carrot);
            bowl.Add(potato);
        }
Exemplo n.º 31
0
        public ActionResult Create([Bind(Include = "Id,BowlSizeId,BiasId,WeightId,InLocker,OwnerName,Comment")] Bowl bowl)
        {
            if (ModelState.IsValid)
            {
                db.Bowls.Add(bowl);
                db.SaveChanges();
                return(RedirectToAction("FileUpload", new { id = bowl.Id }));
            }

            ViewBag.BiasId     = new SelectList(db.Biases, "Id", "BiasSize", bowl.BiasId);
            ViewBag.BowlSizeId = new SelectList(db.Bowlsizes, "Id", "Size", bowl.BowlSizeId);
            ViewBag.WeightId   = new SelectList(db.Weights, "Id", "BowlWeight", bowl.WeightId);
            return(View(bowl));
        }
Exemplo n.º 32
0
        public void Cook(Vegetable vegetable)
        {
            Potato potato = new Potato();
            potato.Peel();
            potato.Cut();

            Carrot carrot = new Carrot();
            carrot.Peel();
            carrot.Cut();

            Bowl bowl = new Bowl();
            bowl.Add(potato);
            bowl.Add(carrot);
        }
Exemplo n.º 33
0
        // GET: Home/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Bowl bowl = db.Bowls.Find(id);

            if (bowl == null)
            {
                return(HttpNotFound());
            }
            return(View(bowl));
        }
Exemplo n.º 34
0
        public void Cook()
        {
            Potato potato = new Potato();
            Carrot carrot = new Carrot();
            Bowl bowl = new Bowl();

            Potato.Peel(potato);
            Carrot.Peel(carrot);

            this.Cut(potato);
            this.Cut(carrot);

            bowl.AddVegetable(potato);
            bowl.AddVegetable(carrot);
        }
Exemplo n.º 35
0
    public Bowl Cook()
    {
        var resultBowl = new Bowl();
        var vegetables = new List<Vegetable>();

        vegetables.Add(Potato.GetPotato());
        vegetables.Add(Carrot.GetCarrot());

        foreach (var vegetable in vegetables)
        {
            this.Peel(vegetable);
            this.Cut(vegetable);
            resultBowl.AddContent(vegetable);
        }

        return resultBowl;
    }
Exemplo n.º 36
0
 private Bowl GetBowl()
 {
     Bowl bowl = new Bowl();
     return bowl;
 }
Exemplo n.º 37
0
 public Chef()
 {
     this.bowl = new Bowl();
     this.vegetables = new List<Vegetable>();
 }
Exemplo n.º 38
0
        private Bowl GetBowl()
        {
            var bowl = new Bowl();

            return bowl;
        }
Exemplo n.º 39
0
 private Bowl GetBow()
 {
     Bowl result = new Bowl();
     return result;
 }
Exemplo n.º 40
0
 private Bowl GetBowl()
 {
     Bowl newBowl = new Bowl();
     return newBowl;
 }