new
(
)
__gc
(
)
__eq
(
am.store
rhs
)
->
(
boolean
)
owner
(
)
->
(
am.character
)
owner
(
am.character
owner
)
->
(
am.store
)
store_id
(
)
->
(
string
)
buy
(
am.character
buyer
,
am.item
item
,
number
value_factor
= 1.0
)
->
(
am.return_code
)
sell
(
am.character
seller
,
am.item
item
,
number
value_factor
= 1.0
,
boolean
make_new_inventory
= false
,
boolean
allow_zero_coin
= false
)
->
(
am.return_code
)
create_inventory
(
)
->
(
am.inventory
)
add_inventory
(
am.inventory
inventory
)
->
(
boolean
)
remove_inventory
(
am.inventory
inventory
)
->
(
boolean
)
remove_all_inventories
(
)
->
(
am.store
)
inventory
(
integer
index
)
->
(
am.inventory
)
inventories
(
)
->
(
array
)
num_inventories
(
)
->
(
array
)
default_inventory_size
(
)
->
(
array
)
new
(
)
__gc
(
)
__eq
(
am.store
rhs
)
->
(
boolean
)
owner
(
)
->
(
am.character
)
owner
(
am.character
owner
)
->
(
am.store
)
store_id
(
)
->
(
string
)
buy
(
am.character
buyer
,
am.item
item
,
number
value_factor
= 1.0
)
->
(
am.return_code
)
success | The item was bought. |
nil_parameter | The buyer or item was nil. |
no_store_owner | Cannot buy the item with no store owner. |
no_inventories | Could not find the item in the store because there are no inventories. |
item_not_in_inventory | Could not find the item in the store inventories. |
not_enough_coin | Buyer does not have enough coin to buy the item. |
sell
(
am.character
seller
,
am.item
item
,
number
value_factor
= 1.0
,
boolean
make_new_inventory
= false
,
boolean
allow_zero_coin
= false
)
->
(
am.return_code
)
success | The item was sold. |
nil_parameter | The seller or item was nil. |
no_store_owner | Cannot sell the item with no store owner. |
no_inventories | No inventories and make_new_inventory is false. |
not_enough_inventory_space | Not enough space in the inventories to fit the item and make_new_inventory is false. |
not_enough_coin | Store owner does not have enough coin to buy the item and allow_zero_coin is false. |
create_inventory
(
)
->
(
am.inventory
)
add_inventory
(
am.inventory
inventory
)
->
(
boolean
)
remove_inventory
(
am.inventory
inventory
)
->
(
boolean
)
remove_all_inventories
(
)
->
(
am.store
)
inventory
(
integer
index
)
->
(
am.inventory
)
inventories
(
)
->
(
array
)
num_inventories
(
)
->
(
array
)
default_inventory_size
(
)
->
(
array
)