class Game { void createItem(String name, Integer value, String description = '') { ... } void increaseValueOfItem(String name, Integer amount) { ... } void decreaseValueOfItem(String name, Integer amount) { ... } Integer getValueOfItem(String name) { ... } Integer getTotalValueOfItems() { ... } Item findItem(name) { ... } def name // name of game def items = [ : ] // items in the game }