Exemplo n.º 1
0
 public void Setup(Piatto currentItem, ShopScrollList currentScrollList)
 {
     item           = currentItem;
     nameLabel.text = item.Nome;
     iconImage      = item.UrlFoto;
     priceText.text = ("€ " + item.Prezzo.ToString());
     scrollList     = currentScrollList;
 }
Exemplo n.º 2
0
    public void TryTransferItemToOtherShop(Piatto item)
    {
        AddItem(item, otherShop);
        RefreshDisplay();
        otherShop.RefreshDisplay();

        Debug.Log("attempted");
    }
Exemplo n.º 3
0
 private void RemoveItem(Piatto itemToRemove, ShopScrollList shopList)
 {
     for (int i = shopList.itemList.Count - 1; i >= 0; i--)
     {
         if (shopList.itemList[i] == itemToRemove)
         {
             shopList.itemList.RemoveAt(i);
         }
     }
 }
Exemplo n.º 4
0
    private void AddButtons()
    {
        for (int i = 0; i < itemList.Count; i++)
        {
            Piatto     item      = itemList[i];
            GameObject newButton = buttonObjectPool.GetObject();
            newButton.transform.SetParent(contentPanel);

            SampleButton sampleButton = newButton.GetComponent <SampleButton>();
            sampleButton.Setup(item, this);
        }
    }
Exemplo n.º 5
0
    public static string menufromSS(CallWebService.MenuSoftwareSolutions menuSS)
    {
        NumberStyles style;
        CultureInfo  culture;
        Menu         Menu1 = new Menu();

        Menu1.Piatti = new List <Piatto>();
        foreach (CallWebService.ProductList v in menuSS.ProductList)
        {
            Piatto p = new Piatto();
            p.Nome        = v.Descr;
            p.Ingredienti = v.Descr2;
            p.base64Img   = v.base64Img;
            p.GUID        = v.GUID;
            int.TryParse(v.idart, out p.idart);
            p.Prezzo   = v.Prezzo;
            p.ProdType = v.ProdType;
            p.Note     = v.Appunti;
            bool alreadyExist = Menu1.Tipologia.Contains(v.Categoria);
            if (!alreadyExist)
            {
                Menu1.Tipologia.Add(v.Categoria);
            }
            p.Tipo = v.Categoria;
            if (v.ListaAllergeni != null)
            {
                foreach (var al in v.ListaAllergeni)
                {
                    p.Allergeni.Add(al.id);
                    Menu1.Allergene[al.id] = al.NomeAllergene;
                }
            }
            Menu1.Piatti.Add(p);
        }
        return(JsonConvert.SerializeObject(Menu1));
    }
Exemplo n.º 6
0
 void AddItem(Piatto itemToAdd, ShopScrollList shopList)
 {
     shopList.itemList.Add(itemToAdd);
 }