public Item(GameConstants.ItemType type, int count) { this.type = type; if (count > 0){ this.count = count; } else { this.count = 0; } }
public Item(GameConstants.ItemType type, int count) { this.type = type; if (count > 0) { this.count = count; } else { this.count = 0; } }
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(); }