Groovy Documentation

de.dewarim.goblin.item
[Groovy] Class ItemService

java.lang.Object
  de.dewarim.goblin.item.ItemService

class ItemService

ItemService: provide a list of item types for shops.

Authors:
ingo


Constructor Summary
ItemService()

 
Method Summary
void cleanupItems()

Search all items for those whose amount is 0 and delete them.

void combineItems(Item target, Item source)

java.util.Map fetchItemCategoryTypeMap(java.util.Collection itemTypes)

To display the items of a shop sorted by their category, we need a map of Category:List(Type)

java.util.List fetchItemTypes(Shop shop)

java.util.List fetchUsableItems(PlayerCharacter pc)

Fetch a list of all usable items a player character has on his person.

java.util.List filterItemTypesByCategory(java.util.Collection itemTypes, java.util.List categories)

Item splitItem(Item item, java.lang.Integer amount)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

ItemService

ItemService()


 
Method Detail

cleanupItems

void cleanupItems()
Search all items for those whose amount is 0 and delete them.


combineItems

void combineItems(Item target, Item source)


fetchItemCategoryTypeMap

java.util.Map fetchItemCategoryTypeMap(java.util.Collection itemTypes)
To display the items of a shop sorted by their category, we need a map of Category:List(Type)
Parameters:
itemTypes - list of itemTypes
Returns:
Map of itemCategory to list of itemTypes.


fetchItemTypes

java.util.List fetchItemTypes(Shop shop)


fetchUsableItems

java.util.List fetchUsableItems(PlayerCharacter pc)
Fetch a list of all usable items a player character has on his person.
Parameters:
pc - the PlayerCharacter whose items you want to list.
Returns:
a list of all items of a player which he is carrying, that are usable and have uses left.


filterItemTypesByCategory

java.util.List filterItemTypesByCategory(java.util.Collection itemTypes, java.util.List categories)


splitItem

Item splitItem(Item item, java.lang.Integer amount)


 

Groovy Documentation