GameConfig
State Variables
_tableId
ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000047616d65436f6e666967000000000000);
_fieldLayout
FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0058040014042020000000000000000000000000000000000000000000000000);
_keySchema
Schema constant _keySchema = Schema.wrap(0x0000000000000000000000000000000000000000000000000000000000000000);
_valueSchema
Schema constant _valueSchema = Schema.wrap(0x0058040061031f1f000000000000000000000000000000000000000000000000);
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;
getAdminAddress
Get adminAddress.
function getAdminAddress() internal view returns (address adminAddress);
_getAdminAddress
Get adminAddress.
function _getAdminAddress() internal view returns (address adminAddress);
setAdminAddress
Set adminAddress.
function setAdminAddress(address adminAddress) internal;
_setAdminAddress
Set adminAddress.
function _setAdminAddress(address adminAddress) internal;
getGlobalSpawnIndex
Get globalSpawnIndex.
function getGlobalSpawnIndex() internal view returns (uint32 globalSpawnIndex);
_getGlobalSpawnIndex
Get globalSpawnIndex.
function _getGlobalSpawnIndex() internal view returns (uint32 globalSpawnIndex);
setGlobalSpawnIndex
Set globalSpawnIndex.
function setGlobalSpawnIndex(uint32 globalSpawnIndex) internal;
_setGlobalSpawnIndex
Set globalSpawnIndex.
function _setGlobalSpawnIndex(uint32 globalSpawnIndex) internal;
getFlowRate
Get flowRate.
function getFlowRate() internal view returns (uint256 flowRate);
_getFlowRate
Get flowRate.
function _getFlowRate() internal view returns (uint256 flowRate);
setFlowRate
Set flowRate.
function setFlowRate(uint256 flowRate) internal;
_setFlowRate
Set flowRate.
function _setFlowRate(uint256 flowRate) internal;
getTankCapacity
Get tankCapacity.
function getTankCapacity() internal view returns (uint256 tankCapacity);
_getTankCapacity
Get tankCapacity.
function _getTankCapacity() internal view returns (uint256 tankCapacity);
setTankCapacity
Set tankCapacity.
function setTankCapacity(uint256 tankCapacity) internal;
_setTankCapacity
Set tankCapacity.
function _setTankCapacity(uint256 tankCapacity) internal;
get
Get the full data.
function get() internal view returns (GameConfigData memory _table);
_get
Get the full data.
function _get() internal view returns (GameConfigData memory _table);
set
Set the full data using individual values.
function set(address adminAddress, uint32 globalSpawnIndex, uint256 flowRate, uint256 tankCapacity) internal;
_set
Set the full data using individual values.
function _set(address adminAddress, uint32 globalSpawnIndex, uint256 flowRate, uint256 tankCapacity) internal;
set
Set the full data using the data struct.
function set(GameConfigData memory _table) internal;
_set
Set the full data using the data struct.
function _set(GameConfigData 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 (address adminAddress, uint32 globalSpawnIndex, uint256 flowRate, uint256 tankCapacity);
decode
Decode the tightly packed blobs using this table's field layout.
function decode(bytes memory _staticData, EncodedLengths, bytes memory)
internal
pure
returns (GameConfigData 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() internal;
_deleteRecord
Delete all data for given keys.
function _deleteRecord() internal;
encodeStatic
Tightly pack static (fixed length) data using this table's schema.
function encodeStatic(address adminAddress, uint32 globalSpawnIndex, uint256 flowRate, uint256 tankCapacity)
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(address adminAddress, uint32 globalSpawnIndex, uint256 flowRate, uint256 tankCapacity)
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() internal pure returns (bytes32[] memory);