Inventory

Representation of a Character or container Item inventory

Constructor

new Inventory(init)

Parameters:
Name Type Description
init object
Properties
Name Type Description
items Array.<Item>
max number

Max number of items this inventory can hold

Extends

  • Map

Members

isFull

Methods

addItem(item)

Parameters:
Name Type Description
item Item

getMax() → {number}

Returns:
number

hydrate(state, belongsTo)

Parameters:
Name Type Description
state GameState
belongsTo Character | Item

removeItem(item)

Parameters:
Name Type Description
item Item

setMax(size)

Parameters:
Name Type Description
size number