I'm wandering what would be a suitable way of storing items in inventory. Many games have an inventory that stores different items with its quantity. For example, [ "Herbs" x5, "Torch" x2, ..].
so I came up with a data structure like this in Java;
HashMap> inventory // where Integer -> item id, ArrayList -> there are same items stored in the list
but I thought Is this a good way to store items even if the number of items in each list becomes larger (x99 items) ?
or should I just store the quantity of items instead of storing objects in list? in this case, is using tuple going to be ok? like HashMap>