Example #1
0
    //Change color(overcooked or undercooked)
    IEnumerator ChangeColor(float time, Color final, CookType i)
    {
        float elapsedTime = 0;
        float t           = 0;
        Color start       = new Color(1, 1, 1, 1);

        if (i == CookType.UNDERCOOK)
        {
            transform.GetChild(8).GetComponent <SpriteRenderer>().sprite = transform.GetChild(8).GetComponent <foodSprites>().undercooked;
        }
        if (i == CookType.OVERCOOK)
        {
            transform.GetChild(8).GetComponent <SpriteRenderer>().sprite = transform.GetChild(8).GetComponent <foodSprites>().overcooked;
        }
        if (i == CookType.PERFECT)
        {
            transform.GetChild(8).GetComponent <SpriteRenderer>().sprite = transform.GetChild(8).GetComponent <foodSprites>().cooked;
        }
        final = new Color(1, 1, 1, 0);
        while (t < time)
        {
            elapsedTime += Time.deltaTime;
            t            = elapsedTime / time;
            gameObject.transform.GetChild(0).gameObject.GetComponent <SpriteRenderer> ().color = Color.Lerp(start, final, t);
            yield return(null);
        }

        /*switch (i) {
         * case CookType.OVERCOOK:
         *      StartCoroutine (ChangeColor (2.0f, new Color (0, 0, 0, 255), CookType.OVERCOOK));
         *      break;
         * }*/
    }
Example #2
0
 private void Confirmbtn_Click(object sender, EventArgs e)
 {
     if (Foodcbb.SelectedItem.ToString() == "Chicken")
     {
         MessageBox.Show(MenuFacade.getInstance().getChicken());
     }
     else if (Foodcbb.SelectedItem.ToString() == "Pork")
     {
         MessageBox.Show(MenuFacade.getInstance().getPork());
     }
     else if (Foodcbb.SelectedItem.ToString() == "Beef")
     {
         MessageBox.Show(MenuFacade.getInstance().getBeef());
     }
     if (Cookcbb.SelectedItem.ToString() == "Grilled")
     {
         CookType Grilled = MenuFactory.getCookType(Cooktypes.Grilled);
         MessageBox.Show(Grilled.OpenCookType());
     }
     else if (Cookcbb.SelectedItem.ToString() == "Fry")
     {
         CookType Fry = MenuFactory.getCookType(Cooktypes.Fry);
         MessageBox.Show(Fry.OpenCookType());
     }
     else
     {
         CookType Boiled = MenuFactory.getCookType(Cooktypes.Boiled);
         MessageBox.Show(Boiled.OpenCookType());
     }
 }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            CookType cookType = db.CookTypes.Find(id);

            db.CookTypes.Remove(cookType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "CookId,CookType1")] CookType cookType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cookType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cookType));
 }
Example #5
0
 public Order(int qt, String desc, int tableID, double price, CookType cookDestination)
 {
     //id = "t"+tableID+"o"+ID++;
     id                   = GenerateId();
     Description          = desc;
     this.tableID         = tableID;
     this.price           = price;
     this.cookDestination = cookDestination;
     this.State           = OrderState.Waiting;
     this.qt              = qt;
 }
Example #6
0
 public Order(int qt, String desc,int tableID, double price, CookType cookDestination)
 {
     //id = "t"+tableID+"o"+ID++;
     id = GenerateId();
     Description = desc;
     this.tableID = tableID;
     this.price = price;
     this.cookDestination = cookDestination;
     this.State = OrderState.Waiting;
     this.qt = qt;
 }
Example #7
0
        public ActionResult Create([Bind(Include = "CookId,CookType1")] CookType cookType)
        {
            if (ModelState.IsValid)
            {
                db.CookTypes.Add(cookType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cookType));
        }
 public ArrayList getAllDestination(CookType ct)
 {
     ArrayList al = new ArrayList();
     ICollection c = this.orders.Values;
     foreach (Order o in c)
     {
         if (o.CookDestination == ct)
             al.Add(o);
     }
     return al;
 }
Example #9
0
        // GET: CookType/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CookType cookType = db.CookTypes.Find(id);

            if (cookType == null)
            {
                return(HttpNotFound());
            }
            return(View(cookType));
        }
    public ArrayList getAllDestination(CookType ct)
    {
        ArrayList   al = new ArrayList();
        ICollection c  = this.orders.Values;

        foreach (Order o in c)
        {
            if (o.CookDestination == ct)
            {
                al.Add(o);
            }
        }
        return(al);
    }
Example #11
0
    private void btnAddRequest_Click(object sender, EventArgs e)
    {
        int      qt              = Convert.ToInt32(txtQt.Text);
        String   desc            = cbDesc.SelectedItem.ToString();
        int      tableID         = Convert.ToInt32(txtTable.Text);
        double   price           = prices[cbDestination.SelectedIndex][cbDesc.SelectedIndex];
        CookType cookDestination = (CookType)Enum.ToObject(typeof(CookType), cbDestination.SelectedIndex);
        Order    o = new Order(qt, desc, tableID, price, cookDestination);

        lbRequests.Items.Add(o.CookDestination + ": " + o.Description + " - Quantity: " + o.Qt);
        txtTable.Enabled    = false;
        btnFinalize.Enabled = true;
        orders.Add(o);
    }
Example #12
0
 public CookClient(MainForm mf, CookType type)
 {
     this.mf    = mf;
     this.cType = type;
     setup();
 }
Example #13
0
File: Cook.cs Project: janisz/prir
 public Cook(Semaphore semaphoreFull, Semaphore semaphoreEmpty, CookType type)
 {
     this.semaphoreEmpty = semaphoreEmpty;
     this.semaphoreFull = semaphoreFull;
     this.type = type;
 }
Example #14
0
 public CookedFood(CookType howCooked, String name, FoodType type)
     : base(name, type)
 {
     this._howCooked = howCooked;
 }