Class: GameItem

GameItem

An item in the inventory

new GameItem (kind, id, nb)

Name Type Description
kind ItemKind Kind of item (item, weapon, or armor)
id number The ID of the item
nb number The occurence of the item in the inventory
Properties:
Name Type Description
k ItemKind Kind of item (item, weapon, or armor)
id number The ID of the item
nb number The occurence of the item in the inventory

Methods

GameItem.findItem (kind, id)Object static

Find an item in the inventory
Name Type Description
kind ItemKind The kind of item
id number The item ID
Returns:
Type Description
Object

remove (nb)Object

Remove item from inventory
Name Type Description
nb number Number of item to remove
Returns:
Type Description
Object

add (nb)Object

Add item in inventory
Name Type Description
nb number Number of item to add
Returns:
Type Description
Object

getItemInformations ()SystemCommonSkillItem

Get the item informations system
Returns:
Type Description
SystemCommonSkillItem

modifyItems (callback)boolean

Modify items only if already in inventory
Name Type Description
callback function callback function for action
Returns:
Type Description
boolean Indicates if the item is already inside the inventory

equalItems ()

Modify the number of the item

addItems ()

Add the number of the item

removeItems ()

Remove the number of the item

multItems ()

Multiply the number of the item

divItems ()

Modify the number of the item

moduloItems ()

Modulo the number of the item

use ()boolean

Use one item and check if the is at least one item left
Returns:
Type Description
boolean