private Bowl GetBowl() { Bowl result = new Bowl(); // ... return(result); }
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); } }
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.."); } }
public void Cook(Vegetable vegetable) { Peel(vegetable); Cut(vegetable); bowl = GetBowl(); bowl.Add(vegetable); }
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")); }
private Bowl GetBowl() { Bowl result = new Bowl(); // ... return result; }
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); } }
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(); }
public void UnregisterBowl(Bowl bowl) { BowlIconData bowlIconData = this.m_Datas[bowl]; UnityEngine.Object.Destroy(bowlIconData.obj); this.m_Datas.Remove(bowl); }
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()); }
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); }
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); }
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); }
public DinnerWareSet(string sku, decimal price, string promoNote, Bowl bowl1, Plate plate1) { Sku = sku; Price = price; PromoNote = promoNote; Bowl1 = bowl1; Plate1 = plate1; }
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); }
public Bowl Cook(Vegetable vegetable) { Bowl bowl = this.GetBowl(); bowl.Add(vegetable); return(bowl); }
public ActionResult DeleteConfirmed(int id) { Bowl bowl = db.Bowls.Find(id); db.Bowls.Remove(bowl); db.SaveChanges(); return(RedirectToAction("Index")); }
public IContainable GetBowl() { var bowl = new Bowl(); this.speachLogger.Say("We have a bowl now!"); return(bowl); }
public void Arrange() { _frameFactory = new FrameFactory(); bowl1 = new Bowl(7); bowl2 = new Bowl(3); //10th Frame Bowl strike = new Bowl(10); }
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); }
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); } }
public void Cook(Vegetable vegetable) { vegetable = this.GetVegetable(); this.Peel(vegetable); this.Cut(vegetable); Bowl bowl = this.GetBowl(); bowl.BowlList.Add(vegetable); }
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)); }
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; } } }
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); }
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); }
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; } }
public void Cook() { Bowl bowl = GetBowl(); Potato potato = GetPotato(); ProcessVegetable(potato); bowl.Add(potato); Carrot carrot = GetCarrot(); ProcessVegetable(carrot); bowl.Add(carrot); }
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); }
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)); }
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); }
// 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)); }
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); }
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; }
private Bowl GetBowl() { Bowl bowl = new Bowl(); return bowl; }
public Chef() { this.bowl = new Bowl(); this.vegetables = new List<Vegetable>(); }
private Bowl GetBowl() { var bowl = new Bowl(); return bowl; }
private Bowl GetBow() { Bowl result = new Bowl(); return result; }
private Bowl GetBowl() { Bowl newBowl = new Bowl(); return newBowl; }