コード例 #1
0
ファイル: Item.cs プロジェクト: jspreddy/LD33
 public Item(GameConstants.ItemType type, int count)
 {
     this.type = type;
     if (count > 0){
         this.count = count;
     }
     else {
         this.count = 0;
     }
 }
コード例 #2
0
 public Item(GameConstants.ItemType type, int count)
 {
     this.type = type;
     if (count > 0)
     {
         this.count = count;
     }
     else
     {
         this.count = 0;
     }
 }
コード例 #3
0
ファイル: ShopManager.cs プロジェクト: jspreddy/LD33
 public void addItemToCart(GameConstants.ItemType type)
 {
     for (int i = 0; i < cartItems.Count; i++)
     {
         if (cartItems[i].getType() == type)
         {
             cartItems[i].incrementCount();
             renderCartItemList();
             return;
         }
     }
     cartItems.Add(new Item(type, 1));
     renderCartItemList();
 }