Android game rpg inventory system

前端 未结 5 910
不知归路
不知归路 2021-01-12 04:37

I am using an ArrayList as my \"inventory\". I am having trouble figuring out a way to add multiples of the same item without taking up a spot in the \"inventory\". For exam

5条回答
  •  一整个雨季
    2021-01-12 05:15

    or an class InventoryField with an item and an integer for the amount.

    public class InventoryField{
        int count;
        Item item;
    }
    
    public class Inventory extends ArrayList{
           ...
        }
    

提交回复
热议问题