Members
Methods
callEvent(type, actoropt) → {EventHandler|undefined}
调用物品事件(共享库存的代价:需要传递事件触发角色)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
type |
string
|
物品事件类型 |
|
actor |
Actor
|
<optional> |
事件触发角色 |
Returns:
- Type:
-
EventHandler|undefined
decrease(quantity)
减少物品的数量,当物品数量不够时将被从库存中移除
Parameters:
| Name | Type | Description |
|---|---|---|
quantity |
number
|
物品数量 |
emit(type, actoropt)
调用物品事件和脚本
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
type |
string
|
物品事件类型 |
|
actor |
Actor
|
<optional> |
事件触发角色 |
Returns:
increase(quantity)
增加物品的数量
Parameters:
| Name | Type | Description |
|---|---|---|
quantity |
number
|
物品数量 |
use(actor) → {EventHandler|undefined}
使用角色物品
Parameters:
| Name | Type | Description |
|---|---|---|
actor |
Actor
|
undefined
|
Returns:
- Type:
-
EventHandler|undefined