private Customer.Item GetRandomFood() { Food food = FoodData[Random.Range(0, FoodData.Count - 1)]; Customer.Item item = new Customer.Item { ID = food.Id, Name = food.Name, Quantity = Random.Range(1, (int)food.Quantity) }; return(item); }
private void AddRow(Customer.Item item, Food food, float subTotal) { GameObject row = Instantiate(ListItemSource); row.transform.SetParent(RegisterList.transform); row.GetComponent <RectTransform>().localScale = new Vector2(1, 1); ListItem listItem = row.GetComponent <ListItem>(); listItem.Quantity.text += (item.Quantity); listItem.Description.text += (food.Name); listItem.Price.text += (food.Price.ToString("0.00")); listItem.SubTotal.text += subTotal.ToString("0.00"); }
private static bool CheckDiscountAvailability(bool isCardExists, Customer.Item item) { return(isCardExists || (item.Quantity % maxItemForDiscount == 0)); }