Inventory(init)

Representation of a Character or container Item inventory

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, carriedBy)

Parameters:
Name Type Description
state GameState
carriedBy Character | Item

removeItem(item)

Parameters:
Name Type Description
item Item

setMax(size)

Parameters:
Name Type Description
size number