Newer
Older
CactusServer / src / main / java / cactusServer / entities / Item.java
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 changeAmount(int amountOfChange) {
		amount = Math.max(amount + amountOfChange, 0);
		return this;
	}
}