Пример #1
0
 void loadListitem()
 {
     WareHouse ser=new WareHouse();
     string[] a=ser.ReturnItem();
     NuItem=(a.Length+1)/9;
     listItem=new item[(a.Length+1)/9];
     for(int i=0;i<(a.Length+1)/9;i++)
     {
         listItem[i] = new item(1,"Cake", 80, 100, 20, 0, 0f, 0f, "image20");
         listItem[i].id=int.Parse(a[i*9+0]);
         listItem[i].name=a[i*9+1];
         listItem[i].priceSell=int.Parse(a[i*9+2]);
         listItem[i].priceBuy=int.Parse(a[i*9+3]);
         listItem[i].valueMana=int.Parse(a[i*9+4]);
         listItem[i].valueBlood=int.Parse(a[i*9+5]);
         listItem[i].percentAttack=int.Parse(a[i*9+6]);
         listItem[i].percentDefence=int.Parse(a[i*9+7]);
         listItem[i].avatar=a[i*9+8];
         print(listItem[i].name);
     }
     /*
     listItem = new item[3]; //load skills from database
     listItem[0] = new item("Cake", 80, 100, 20, 0, 0f, 0f, "image20");
     listItem[1] = new item("Cake", 80, 100, 20, 0, 0f, 0f, "image20");
     listItem[2] = new item("Cake", 80, 100, 20, 0, 0f, 0f, "image20"); */
 }