OrderSystem
Inherits: System
Functions
createOrder
Create an order
Free for admin, charges reward cost (_reward * _maxPlayers) for non-admin
function createOrder(MaterialId _materialId, uint256 _amount, uint256 _reward, uint32 _duration, uint32 _maxPlayers)
public
returns (bytes32 orderEntity);
Parameters
Name | Type | Description |
---|---|---|
_materialId | MaterialId | Material id to produce |
_amount | uint256 | Amount to produce in whole units |
_reward | uint256 | Reward for completing the order in whole units |
_duration | uint32 | Duration of the order. 0 means no expiration |
_maxPlayers | uint32 | Maximum number of players that can accept the order |
Returns
Name | Type | Description |
---|---|---|
orderEntity | bytes32 | Id of the offer entity |
cancelOrder
Cancel an order
Restricted to admin
function cancelOrder(bytes32 _orderEntity) public;
Parameters
Name | Type | Description |
---|---|---|
_orderEntity | bytes32 | Id of the order entity |
acceptOrder
Accept an order
This simply indicates that a user is committed to an order
function acceptOrder(bytes32 _orderEntity) public;
Parameters
Name | Type | Description |
---|---|---|
_orderEntity | bytes32 | Id of the order entity |
unacceptOrder
Unaccept the current order
function unacceptOrder() public;