September 20, 2022



An instance of a tray is a container for holding items. The item owned by the entity are stored, organized and accessed through the tray.


int type (  )

Get tray container type

Entity owner (  )

Get tray owner

int capacity (  )

Tray capacity

int max_capacity (  )

Get the maximum capacity of the tray

int avail_capacity (  )

Return usable capacity

void set_capacity (  int capacity  )

Set tray capacity

void add_capacity (  int capacity  )

Added capacity to the original tray capacity

void set_max_capacity (  int capacity  )

set maximum capacity

boolean is_valid_slot (  int slot  )

Determine whether it is a valid tray slot

int find_free (  boolean force  )

Returns a tray slot with no items placed

item fetch_item (  int slot  )

Returns the item at the specified position in the tray

table query_items (  function cmp  )

Returns a list of item instances based on a filter function

int count_item_num_by_fullname (  string fullname  )

Returns the number of items from the inventory based on the item name

item remove_item (  int slot  )

Removed items from tray slots corresponding to tray

void settle_item (  intslot,item )

Add an item to the specified backpack slot