package cactusServer.entities; public class Item { private String name; private int amount; public Item(String name, int amount) { this.name = name; this.amount = amount; } public String getName() { return name; } public int getAmount() { return amount; } public boolean isEmpty() { return (amount == 0); } public Item addAmount(int num) { amount = Math.max(amount + num, 0); return this; } }