Order
State Variables
_tableId
ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004f726465720000000000000000000000);
_fieldLayout
FieldLayout constant _fieldLayout = FieldLayout.wrap(0x00a6070020140e20202004000000000000000000000000000000000000000000);
_keySchema
Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);
_valueSchema
Schema constant _valueSchema = Schema.wrap(0x00a607001f614d1f1f1f03000000000000000000000000000000000000000000);
Functions
getKeyNames
Get the table's key field names.
function getKeyNames() internal pure returns (string[] memory keyNames);
Returns
Name | Type | Description |
---|---|---|
keyNames | string[] | An array of strings with the names of key fields. |
getFieldNames
Get the table's value field names.
function getFieldNames() internal pure returns (string[] memory fieldNames);
Returns
Name | Type | Description |
---|---|---|
fieldNames | string[] | An array of strings with the names of value fields. |
register
Register the table with its config.
function register() internal;
_register
Register the table with its config.
function _register() internal;
getCreationBlock
Get creationBlock.
function getCreationBlock(bytes32 key) internal view returns (uint256 creationBlock);
_getCreationBlock
Get creationBlock.
function _getCreationBlock(bytes32 key) internal view returns (uint256 creationBlock);
setCreationBlock
Set creationBlock.
function setCreationBlock(bytes32 key, uint256 creationBlock) internal;
_setCreationBlock
Set creationBlock.
function _setCreationBlock(bytes32 key, uint256 creationBlock) internal;
getCreator
Get creator.
function getCreator(bytes32 key) internal view returns (address creator);
_getCreator
Get creator.
function _getCreator(bytes32 key) internal view returns (address creator);
setCreator
Set creator.
function setCreator(bytes32 key, address creator) internal;
_setCreator
Set creator.
function _setCreator(bytes32 key, address creator) internal;
getMaterialId
Get materialId.
function getMaterialId(bytes32 key) internal view returns (MaterialId materialId);
_getMaterialId
Get materialId.
function _getMaterialId(bytes32 key) internal view returns (MaterialId materialId);
setMaterialId
Set materialId.
function setMaterialId(bytes32 key, MaterialId materialId) internal;
_setMaterialId
Set materialId.
function _setMaterialId(bytes32 key, MaterialId materialId) internal;
getAmount
Get amount.
function getAmount(bytes32 key) internal view returns (uint256 amount);
_getAmount
Get amount.
function _getAmount(bytes32 key) internal view returns (uint256 amount);
setAmount
Set amount.
function setAmount(bytes32 key, uint256 amount) internal;
_setAmount
Set amount.
function _setAmount(bytes32 key, uint256 amount) internal;
getExpirationBlock
Get expirationBlock.
function getExpirationBlock(bytes32 key) internal view returns (uint256 expirationBlock);
_getExpirationBlock
Get expirationBlock.
function _getExpirationBlock(bytes32 key) internal view returns (uint256 expirationBlock);
setExpirationBlock
Set expirationBlock.
function setExpirationBlock(bytes32 key, uint256 expirationBlock) internal;
_setExpirationBlock
Set expirationBlock.
function _setExpirationBlock(bytes32 key, uint256 expirationBlock) internal;
getReward
Get reward.
function getReward(bytes32 key) internal view returns (uint256 reward);
_getReward
Get reward.
function _getReward(bytes32 key) internal view returns (uint256 reward);
setReward
Set reward.
function setReward(bytes32 key, uint256 reward) internal;
_setReward
Set reward.
function _setReward(bytes32 key, uint256 reward) internal;
getMaxPlayers
Get maxPlayers.
function getMaxPlayers(bytes32 key) internal view returns (uint32 maxPlayers);
_getMaxPlayers
Get maxPlayers.
function _getMaxPlayers(bytes32 key) internal view returns (uint32 maxPlayers);
setMaxPlayers
Set maxPlayers.
function setMaxPlayers(bytes32 key, uint32 maxPlayers) internal;
_setMaxPlayers
Set maxPlayers.
function _setMaxPlayers(bytes32 key, uint32 maxPlayers) internal;
get
Get the full data.
function get(bytes32 key) internal view returns (OrderData memory _table);
_get
Get the full data.
function _get(bytes32 key) internal view returns (OrderData memory _table);
set
Set the full data using individual values.
function set(
bytes32 key,
uint256 creationBlock,
address creator,
MaterialId materialId,
uint256 amount,
uint256 expirationBlock,
uint256 reward,
uint32 maxPlayers
) internal;
_set
Set the full data using individual values.
function _set(
bytes32 key,
uint256 creationBlock,
address creator,
MaterialId materialId,
uint256 amount,
uint256 expirationBlock,
uint256 reward,
uint32 maxPlayers
) internal;
set
Set the full data using the data struct.
function set(bytes32 key, OrderData memory _table) internal;
_set
Set the full data using the data struct.
function _set(bytes32 key, OrderData memory _table) internal;
decodeStatic
Decode the tightly packed blob of static data using this table's field layout.
function decodeStatic(bytes memory _blob)
internal
pure
returns (
uint256 creationBlock,
address creator,
MaterialId materialId,
uint256 amount,
uint256 expirationBlock,
uint256 reward,
uint32 maxPlayers
);
decode
Decode the tightly packed blobs using this table's field layout.
function decode(bytes memory _staticData, EncodedLengths, bytes memory)
internal
pure
returns (OrderData memory _table);
Parameters
Name | Type | Description |
---|---|---|
_staticData | bytes | Tightly packed static fields. |
<none> | EncodedLengths | |
<none> | bytes |
deleteRecord
Delete all data for given keys.
function deleteRecord(bytes32 key) internal;
_deleteRecord
Delete all data for given keys.
function _deleteRecord(bytes32 key) internal;
encodeStatic
Tightly pack static (fixed length) data using this table's schema.
function encodeStatic(
uint256 creationBlock,
address creator,
MaterialId materialId,
uint256 amount,
uint256 expirationBlock,
uint256 reward,
uint32 maxPlayers
) internal pure returns (bytes memory);
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The static data, encoded into a sequence of bytes. |
encode
Encode all of a record's fields.
function encode(
uint256 creationBlock,
address creator,
MaterialId materialId,
uint256 amount,
uint256 expirationBlock,
uint256 reward,
uint32 maxPlayers
) internal pure returns (bytes memory, EncodedLengths, bytes memory);
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The static (fixed length) data, encoded into a sequence of bytes. |
<none> | EncodedLengths | The lengths of the dynamic fields (packed into a single bytes32 value). |
<none> | bytes | The dynamic (variable length) data, encoded into a sequence of bytes. |
encodeKeyTuple
Encode keys as a bytes32 array using this table's field layout.
function encodeKeyTuple(bytes32 key) internal pure returns (bytes32[] memory);