The Inventory system
get_inventory_value(id_or_object, key, default=None)
get inventory value with the given key the the agent has this is the way to create a collection in inventory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
The agent id or object to check |
required |
key
|
str
|
The key/name of the inventory item |
required |
default
|
any
|
the default value data |
None
|
get_shared_inventory_value(key, default=None)
get inventory value from the shared data agent
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key/name of the inventory item |
required |
default
|
any
|
the value to return if not found |
None
|
has_inventory(key)
get the set of agent ids that have a inventory item with the given key
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key/name of the inventory item |
required |
Returns:
Name | Type | Description |
---|---|---|
set |
set of ids |
has_inventory_value(key, value)
get the object that have a inventory item with the given key
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key/name of the inventory item |
required |
Returns:
Name | Type | Description |
---|---|---|
set |
set of ids |
inventory_set(source, key)
get the set that inventory items with the given key the the link source has this is the way to create a collection in inventory
Note
This is like set_inventory_value bu the value is a set
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
agent
|
The agent id or object to check |
required |
key
|
str
|
The key/name of the inventory item |
required |
set
|
set of data |
required |
inventory_value(id_or_obj, key, default=None)
get inventory value with the given key the the agent has this is the way to create a collection in inventory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
The agent id or object to check |
required |
key
|
str
|
The key/name of the inventory item |
required |
default
|
any
|
the default value data |
None
|
set_inventory_value(so, key, value)
set inventory value with the given key the the agent has this is the way to create a collection in inventory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
The agent id or object to check |
required |
key
|
str
|
The key/name of the inventory item |
required |
value
|
any
|
the value |
required |
set_shared_inventory_value(key, value)
set inventory value with the given key on the shared agent
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key/name of the inventory item |
required |
value
|
any
|
the value |
required |