Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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");
    }
Esempio n. 3
0
 private static bool CheckDiscountAvailability(bool isCardExists, Customer.Item item)
 {
     return(isCardExists || (item.Quantity % maxItemForDiscount == 0));
 }