This Cursed Machine

THIS CURSED MACHINE is a sci-fi body horror fulfilment centre simulator. Reverse engineer complex recipes and use your own body as a large scale production circuit. Build strange machines and connect them in intricate supply chains to fulfil orders more quickly than the other workers.

Redstone deploy

Concepts

  • Pod: Container for a player's game. Holds machines, tanks, etc...
  • Network: Machines and connections that transform materials.
  • Machine: Node in the network that transforms materials.
  • Player: Known as stump in the UI. The player's avatar in the game. A machine.
  • Recipe: Rule for how a machine transforms an input into an output.
  • Tank: Storage space for materials.
  • Order: Request for an amount of a material. Player is rewarded with $BUGS on fulfilment.
  • Offer: A material that can be bought for $BUGS. Deposited in a tank.

Framework

Built with MUD.

Overview

The central function is LibNetwork.resolve. It reads from tanks connected to the inlets, traverse the network of nodes (machines) and connections, transforming the material in the process. The calculated output is for a single block.

In LibTank.write we then multiply the result by the number of blocks that have passed since the last resolution, taking into account the caps imposed by the available input amounts as well as the limited storage capacity of the output tank. Finally we update the tanks with the new amounts and material types.

We have to run LibNetwork.resolve every time the network is changed in a meaningful way (connections made, etc...).

A matching resolve function in the client runs every block to give an impression of continuous transformation in the UI.

Progression

The player has to pass through a tutorial, completing a series of orders to unlock the full game. At the end of this they can name themselves and have access to the full game.

Materials and tokens

Materials are represented by materialId in the network and in tanks. These are connecteed to ERC20 contracts. $BUGS are minted to players on order fulfilment. For user created orders we mint the material to the creator of the order when a player ships it.

Units

All tokens and material amounts have 18 decimals. In the UI we divide by 1e18 to show the amounts in a more human readable format. Arguments to createOrder and and createOffer are also in this format.

Contents

Contents

Amount

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000416d6f756e7400000000000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint256 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint256 value);

get

Get value.

function get(bytes32 id) internal view returns (uint256 value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint256 value);

setValue

Set value.

function setValue(bytes32 id, uint256 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint256 value) internal;

set

Set value.

function set(bytes32 id, uint256 value) internal;

_set

Set value.

function _set(bytes32 id, uint256 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(uint256 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint256 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

BuildIndex

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004275696c64496e646578000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0004010004000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0004010003000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint32 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint32 value);

get

Get value.

function get(bytes32 id) internal view returns (uint32 value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint32 value);

setValue

Set value.

function setValue(bytes32 id, uint32 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint32 value) internal;

set

Set value.

function set(bytes32 id, uint32 value) internal;

_set

Set value.

function _set(bytes32 id, uint32 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(uint32 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint32 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

BuildTracker

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004275696c64547261636b657200000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0000000165000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint32[] memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint32[] memory value);

get

Get value.

function get(bytes32 id) internal view returns (uint32[] memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint32[] memory value);

setValue

Set value.

function setValue(bytes32 id, uint32[] memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint32[] memory value) internal;

set

Set value.

function set(bytes32 id, uint32[] memory value) internal;

_set

Set value.

function _set(bytes32 id, uint32[] memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (uint32);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (uint32);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (uint32);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (uint32);

pushValue

Push an element to value.

function pushValue(bytes32 id, uint32 _element) internal;

_pushValue

Push an element to value.

function _pushValue(bytes32 id, uint32 _element) internal;

push

Push an element to value.

function push(bytes32 id, uint32 _element) internal;

_push

Push an element to value.

function _push(bytes32 id, uint32 _element) internal;

popValue

Pop an element from value.

function popValue(bytes32 id) internal;

_popValue

Pop an element from value.

function _popValue(bytes32 id) internal;

pop

Pop an element from value.

function pop(bytes32 id) internal;

_pop

Pop an element from value.

function _pop(bytes32 id) internal;

updateValue

Update an element of value at _index.

function updateValue(bytes32 id, uint256 _index, uint32 _element) internal;

_updateValue

Update an element of value at _index.

function _updateValue(bytes32 id, uint256 _index, uint32 _element) internal;

update

Update an element of value at _index.

function update(bytes32 id, uint256 _index, uint32 _element) internal;

_update

Update an element of value at _index.

function _update(bytes32 id, uint256 _index, uint32 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(uint32[] memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(uint32[] memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint32[] memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

CarriedBy

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000043617272696564427900000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32 value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32 value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32 value);

setValue

Set value.

function setValue(bytes32 id, bytes32 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32 value) internal;

set

Set value.

function set(bytes32 id, bytes32 value) internal;

_set

Set value.

function _set(bytes32 id, bytes32 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(bytes32 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

CompletedOrders

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000436f6d706c657465644f726465727300);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001c1000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32[] memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32[] memory value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32[] memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32[] memory value);

setValue

Set value.

function setValue(bytes32 id, bytes32[] memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32[] memory value) internal;

set

Set value.

function set(bytes32 id, bytes32[] memory value) internal;

_set

Set value.

function _set(bytes32 id, bytes32[] memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

pushValue

Push an element to value.

function pushValue(bytes32 id, bytes32 _element) internal;

_pushValue

Push an element to value.

function _pushValue(bytes32 id, bytes32 _element) internal;

push

Push an element to value.

function push(bytes32 id, bytes32 _element) internal;

_push

Push an element to value.

function _push(bytes32 id, bytes32 _element) internal;

popValue

Pop an element from value.

function popValue(bytes32 id) internal;

_popValue

Pop an element from value.

function _popValue(bytes32 id) internal;

pop

Pop an element from value.

function pop(bytes32 id) internal;

_pop

Pop an element from value.

function _pop(bytes32 id) internal;

updateValue

Update an element of value at _index.

function updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

_updateValue

Update an element of value at _index.

function _updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

update

Update an element of value at _index.

function update(bytes32 id, uint256 _index, bytes32 _element) internal;

_update

Update an element of value at _index.

function _update(bytes32 id, uint256 _index, bytes32 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes32[] memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes32[] memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32[] memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

CompletedPlayers

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000436f6d706c65746564506c6179657273);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0004010004000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0004010003000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint32 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint32 value);

get

Get value.

function get(bytes32 id) internal view returns (uint32 value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint32 value);

setValue

Set value.

function setValue(bytes32 id, uint32 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint32 value) internal;

set

Set value.

function set(bytes32 id, uint32 value) internal;

_set

Set value.

function _set(bytes32 id, uint32 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(uint32 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint32 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

ContainedMaterial

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000436f6e7461696e65644d617465726961);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x000e01000e000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x000e01004d000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (MaterialId value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (MaterialId value);

get

Get value.

function get(bytes32 id) internal view returns (MaterialId value);

_get

Get value.

function _get(bytes32 id) internal view returns (MaterialId value);

setValue

Set value.

function setValue(bytes32 id, MaterialId value) internal;

_setValue

Set value.

function _setValue(bytes32 id, MaterialId value) internal;

set

Set value.

function set(bytes32 id, MaterialId value) internal;

_set

Set value.

function _set(bytes32 id, MaterialId value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(MaterialId value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(MaterialId value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

CurrentOrder

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000043757272656e744f7264657200000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32 value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32 value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32 value);

setValue

Set value.

function setValue(bytes32 id, bytes32 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32 value) internal;

set

Set value.

function set(bytes32 id, bytes32 value) internal;

_set

Set value.

function _set(bytes32 id, bytes32 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(bytes32 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

EntityType

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000456e7469747954797065000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0001010001000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0001010000000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (ENTITY_TYPE value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (ENTITY_TYPE value);

get

Get value.

function get(bytes32 id) internal view returns (ENTITY_TYPE value);

_get

Get value.

function _get(bytes32 id) internal view returns (ENTITY_TYPE value);

setValue

Set value.

function setValue(bytes32 id, ENTITY_TYPE value) internal;

_setValue

Set value.

function _setValue(bytes32 id, ENTITY_TYPE value) internal;

set

Set value.

function set(bytes32 id, ENTITY_TYPE value) internal;

_set

Set value.

function _set(bytes32 id, ENTITY_TYPE value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(ENTITY_TYPE value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(ENTITY_TYPE value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

FixedEntitiesData

Git Source

struct FixedEntitiesData {
    bytes32 outlet;
    bytes32[] inlets;
}

FixedEntities

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004669786564456e746974696573000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0020010120000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x002001015fc10000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getOutlet

Get outlet.

function getOutlet(bytes32 key) internal view returns (bytes32 outlet);

_getOutlet

Get outlet.

function _getOutlet(bytes32 key) internal view returns (bytes32 outlet);

setOutlet

Set outlet.

function setOutlet(bytes32 key, bytes32 outlet) internal;

_setOutlet

Set outlet.

function _setOutlet(bytes32 key, bytes32 outlet) internal;

getInlets

Get inlets.

function getInlets(bytes32 key) internal view returns (bytes32[] memory inlets);

_getInlets

Get inlets.

function _getInlets(bytes32 key) internal view returns (bytes32[] memory inlets);

setInlets

Set inlets.

function setInlets(bytes32 key, bytes32[] memory inlets) internal;

_setInlets

Set inlets.

function _setInlets(bytes32 key, bytes32[] memory inlets) internal;

lengthInlets

Get the length of inlets.

function lengthInlets(bytes32 key) internal view returns (uint256);

_lengthInlets

Get the length of inlets.

function _lengthInlets(bytes32 key) internal view returns (uint256);

getItemInlets

Get an item of inlets.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemInlets(bytes32 key, uint256 _index) internal view returns (bytes32);

_getItemInlets

Get an item of inlets.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemInlets(bytes32 key, uint256 _index) internal view returns (bytes32);

pushInlets

Push an element to inlets.

function pushInlets(bytes32 key, bytes32 _element) internal;

_pushInlets

Push an element to inlets.

function _pushInlets(bytes32 key, bytes32 _element) internal;

popInlets

Pop an element from inlets.

function popInlets(bytes32 key) internal;

_popInlets

Pop an element from inlets.

function _popInlets(bytes32 key) internal;

updateInlets

Update an element of inlets at _index.

function updateInlets(bytes32 key, uint256 _index, bytes32 _element) internal;

_updateInlets

Update an element of inlets at _index.

function _updateInlets(bytes32 key, uint256 _index, bytes32 _element) internal;

get

Get the full data.

function get(bytes32 key) internal view returns (FixedEntitiesData memory _table);

_get

Get the full data.

function _get(bytes32 key) internal view returns (FixedEntitiesData memory _table);

set

Set the full data using individual values.

function set(bytes32 key, bytes32 outlet, bytes32[] memory inlets) internal;

_set

Set the full data using individual values.

function _set(bytes32 key, bytes32 outlet, bytes32[] memory inlets) internal;

set

Set the full data using the data struct.

function set(bytes32 key, FixedEntitiesData memory _table) internal;

_set

Set the full data using the data struct.

function _set(bytes32 key, FixedEntitiesData 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 (bytes32 outlet);

decodeDynamic

Decode the tightly packed blob of dynamic data using the encoded lengths.

function decodeDynamic(EncodedLengths _encodedLengths, bytes memory _blob)
    internal
    pure
    returns (bytes32[] memory inlets);

decode

Decode the tightly packed blobs using this table's field layout.

function decode(bytes memory _staticData, EncodedLengths _encodedLengths, bytes memory _dynamicData)
    internal
    pure
    returns (FixedEntitiesData memory _table);

Parameters

NameTypeDescription
_staticDatabytesTightly packed static fields.
_encodedLengthsEncodedLengthsEncoded lengths of dynamic fields.
_dynamicDatabytesTightly packed dynamic fields.

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(bytes32 outlet) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes32[] memory inlets) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes32[] memory inlets) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32 outlet, bytes32[] memory inlets)
    internal
    pure
    returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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);

GameConfigData

Git Source

struct GameConfigData {
    address adminAddress;
    uint32 globalSpawnIndex;
    uint256 flowRate;
    uint256 tankCapacity;
}

GameConfig

Git Source

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

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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

NameTypeDescription
_staticDatabytesTightly 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

NameTypeDescription
<none>bytesThe 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

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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);

IncomingConnections

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000496e636f6d696e67436f6e6e65637469);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001c1000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32[] memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32[] memory value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32[] memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32[] memory value);

setValue

Set value.

function setValue(bytes32 id, bytes32[] memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32[] memory value) internal;

set

Set value.

function set(bytes32 id, bytes32[] memory value) internal;

_set

Set value.

function _set(bytes32 id, bytes32[] memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

pushValue

Push an element to value.

function pushValue(bytes32 id, bytes32 _element) internal;

_pushValue

Push an element to value.

function _pushValue(bytes32 id, bytes32 _element) internal;

push

Push an element to value.

function push(bytes32 id, bytes32 _element) internal;

_push

Push an element to value.

function _push(bytes32 id, bytes32 _element) internal;

popValue

Pop an element from value.

function popValue(bytes32 id) internal;

_popValue

Pop an element from value.

function _popValue(bytes32 id) internal;

pop

Pop an element from value.

function pop(bytes32 id) internal;

_pop

Pop an element from value.

function _pop(bytes32 id) internal;

updateValue

Update an element of value at _index.

function updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

_updateValue

Update an element of value at _index.

function _updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

update

Update an element of value at _index.

function update(bytes32 id, uint256 _index, bytes32 _element) internal;

_update

Update an element of value at _index.

function _update(bytes32 id, uint256 _index, bytes32 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes32[] memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes32[] memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32[] memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

LastResolved

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004c6173745265736f6c76656400000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint256 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint256 value);

get

Get value.

function get(bytes32 id) internal view returns (uint256 value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint256 value);

setValue

Set value.

function setValue(bytes32 id, uint256 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint256 value) internal;

set

Set value.

function set(bytes32 id, uint256 value) internal;

_set

Set value.

function _set(bytes32 id, uint256 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(uint256 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint256 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

MachineType

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004d616368696e65547970650000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0001010001000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0001010000000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (MACHINE_TYPE value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (MACHINE_TYPE value);

get

Get value.

function get(bytes32 id) internal view returns (MACHINE_TYPE value);

_get

Get value.

function _get(bytes32 id) internal view returns (MACHINE_TYPE value);

setValue

Set value.

function setValue(bytes32 id, MACHINE_TYPE value) internal;

_setValue

Set value.

function _setValue(bytes32 id, MACHINE_TYPE value) internal;

set

Set value.

function set(bytes32 id, MACHINE_TYPE value) internal;

_set

Set value.

function _set(bytes32 id, MACHINE_TYPE value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(MACHINE_TYPE value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(MACHINE_TYPE value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

MachinesInPod

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004d616368696e6573496e506f64000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001c1000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32[] memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32[] memory value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32[] memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32[] memory value);

setValue

Set value.

function setValue(bytes32 id, bytes32[] memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32[] memory value) internal;

set

Set value.

function set(bytes32 id, bytes32[] memory value) internal;

_set

Set value.

function _set(bytes32 id, bytes32[] memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

pushValue

Push an element to value.

function pushValue(bytes32 id, bytes32 _element) internal;

_pushValue

Push an element to value.

function _pushValue(bytes32 id, bytes32 _element) internal;

push

Push an element to value.

function push(bytes32 id, bytes32 _element) internal;

_push

Push an element to value.

function _push(bytes32 id, bytes32 _element) internal;

popValue

Pop an element from value.

function popValue(bytes32 id) internal;

_popValue

Pop an element from value.

function _popValue(bytes32 id) internal;

pop

Pop an element from value.

function pop(bytes32 id) internal;

_pop

Pop an element from value.

function _pop(bytes32 id) internal;

updateValue

Update an element of value at _index.

function updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

_updateValue

Update an element of value at _index.

function _updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

update

Update an element of value at _index.

function update(bytes32 id, uint256 _index, bytes32 _element) internal;

_update

Update an element of value at _index.

function _update(bytes32 id, uint256 _index, bytes32 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes32[] memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes32[] memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32[] memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

MaterialMetadataData

Git Source

struct MaterialMetadataData {
    MATERIAL_DIFFICULTY difficulty;
    address tokenAddress;
    string name;
}

MaterialMetadata

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004d6174657269616c4d65746164617461);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0015020101140000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x000e01004d000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x001502010061c500000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getDifficulty

Get difficulty.

function getDifficulty(MaterialId materialId) internal view returns (MATERIAL_DIFFICULTY difficulty);

_getDifficulty

Get difficulty.

function _getDifficulty(MaterialId materialId) internal view returns (MATERIAL_DIFFICULTY difficulty);

setDifficulty

Set difficulty.

function setDifficulty(MaterialId materialId, MATERIAL_DIFFICULTY difficulty) internal;

_setDifficulty

Set difficulty.

function _setDifficulty(MaterialId materialId, MATERIAL_DIFFICULTY difficulty) internal;

getTokenAddress

Get tokenAddress.

function getTokenAddress(MaterialId materialId) internal view returns (address tokenAddress);

_getTokenAddress

Get tokenAddress.

function _getTokenAddress(MaterialId materialId) internal view returns (address tokenAddress);

setTokenAddress

Set tokenAddress.

function setTokenAddress(MaterialId materialId, address tokenAddress) internal;

_setTokenAddress

Set tokenAddress.

function _setTokenAddress(MaterialId materialId, address tokenAddress) internal;

getName

Get name.

function getName(MaterialId materialId) internal view returns (string memory name);

_getName

Get name.

function _getName(MaterialId materialId) internal view returns (string memory name);

setName

Set name.

function setName(MaterialId materialId, string memory name) internal;

_setName

Set name.

function _setName(MaterialId materialId, string memory name) internal;

lengthName

Get the length of name.

function lengthName(MaterialId materialId) internal view returns (uint256);

_lengthName

Get the length of name.

function _lengthName(MaterialId materialId) internal view returns (uint256);

getItemName

Get an item of name.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemName(MaterialId materialId, uint256 _index) internal view returns (string memory);

_getItemName

Get an item of name.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemName(MaterialId materialId, uint256 _index) internal view returns (string memory);

pushName

Push a slice to name.

function pushName(MaterialId materialId, string memory _slice) internal;

_pushName

Push a slice to name.

function _pushName(MaterialId materialId, string memory _slice) internal;

popName

Pop a slice from name.

function popName(MaterialId materialId) internal;

_popName

Pop a slice from name.

function _popName(MaterialId materialId) internal;

updateName

Update a slice of name at _index.

function updateName(MaterialId materialId, uint256 _index, string memory _slice) internal;

_updateName

Update a slice of name at _index.

function _updateName(MaterialId materialId, uint256 _index, string memory _slice) internal;

get

Get the full data.

function get(MaterialId materialId) internal view returns (MaterialMetadataData memory _table);

_get

Get the full data.

function _get(MaterialId materialId) internal view returns (MaterialMetadataData memory _table);

set

Set the full data using individual values.

function set(MaterialId materialId, MATERIAL_DIFFICULTY difficulty, address tokenAddress, string memory name)
    internal;

_set

Set the full data using individual values.

function _set(MaterialId materialId, MATERIAL_DIFFICULTY difficulty, address tokenAddress, string memory name)
    internal;

set

Set the full data using the data struct.

function set(MaterialId materialId, MaterialMetadataData memory _table) internal;

_set

Set the full data using the data struct.

function _set(MaterialId materialId, MaterialMetadataData 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 (MATERIAL_DIFFICULTY difficulty, address tokenAddress);

decodeDynamic

Decode the tightly packed blob of dynamic data using the encoded lengths.

function decodeDynamic(EncodedLengths _encodedLengths, bytes memory _blob) internal pure returns (string memory name);

decode

Decode the tightly packed blobs using this table's field layout.

function decode(bytes memory _staticData, EncodedLengths _encodedLengths, bytes memory _dynamicData)
    internal
    pure
    returns (MaterialMetadataData memory _table);

Parameters

NameTypeDescription
_staticDatabytesTightly packed static fields.
_encodedLengthsEncodedLengthsEncoded lengths of dynamic fields.
_dynamicDatabytesTightly packed dynamic fields.

deleteRecord

Delete all data for given keys.

function deleteRecord(MaterialId materialId) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(MaterialId materialId) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(MATERIAL_DIFFICULTY difficulty, address tokenAddress) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(string memory name) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(string memory name) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(MATERIAL_DIFFICULTY difficulty, address tokenAddress, string memory name)
    internal
    pure
    returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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(MaterialId materialId) internal pure returns (bytes32[] memory);

Name

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004e616d65000000000000000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001c5000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (string memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (string memory value);

get

Get value.

function get(bytes32 id) internal view returns (string memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (string memory value);

setValue

Set value.

function setValue(bytes32 id, string memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, string memory value) internal;

set

Set value.

function set(bytes32 id, string memory value) internal;

_set

Set value.

function _set(bytes32 id, string memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (string memory);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (string memory);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (string memory);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (string memory);

pushValue

Push a slice to value.

function pushValue(bytes32 id, string memory _slice) internal;

_pushValue

Push a slice to value.

function _pushValue(bytes32 id, string memory _slice) internal;

push

Push a slice to value.

function push(bytes32 id, string memory _slice) internal;

_push

Push a slice to value.

function _push(bytes32 id, string memory _slice) internal;

popValue

Pop a slice from value.

function popValue(bytes32 id) internal;

_popValue

Pop a slice from value.

function _popValue(bytes32 id) internal;

pop

Pop a slice from value.

function pop(bytes32 id) internal;

_pop

Pop a slice from value.

function _pop(bytes32 id) internal;

updateValue

Update a slice of value at _index.

function updateValue(bytes32 id, uint256 _index, string memory _slice) internal;

_updateValue

Update a slice of value at _index.

function _updateValue(bytes32 id, uint256 _index, string memory _slice) internal;

update

Update a slice of value at _index.

function update(bytes32 id, uint256 _index, string memory _slice) internal;

_update

Update a slice of value at _index.

function _update(bytes32 id, uint256 _index, string memory _slice) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(string memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(string memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(string memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

NonTransferableBalance

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004e6f6e5472616e7366657261626c6542);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint256 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint256 value);

get

Get value.

function get(bytes32 id) internal view returns (uint256 value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint256 value);

setValue

Set value.

function setValue(bytes32 id, uint256 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint256 value) internal;

set

Set value.

function set(bytes32 id, uint256 value) internal;

_set

Set value.

function _set(bytes32 id, uint256 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(uint256 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint256 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

OfferData

Git Source

struct OfferData {
    MaterialId materialId;
    uint256 amount;
    uint256 cost;
}

Offer

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004f666665720000000000000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x004e03000e202000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x004e03004d1f1f00000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

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;

getCost

Get cost.

function getCost(bytes32 key) internal view returns (uint256 cost);

_getCost

Get cost.

function _getCost(bytes32 key) internal view returns (uint256 cost);

setCost

Set cost.

function setCost(bytes32 key, uint256 cost) internal;

_setCost

Set cost.

function _setCost(bytes32 key, uint256 cost) internal;

get

Get the full data.

function get(bytes32 key) internal view returns (OfferData memory _table);

_get

Get the full data.

function _get(bytes32 key) internal view returns (OfferData memory _table);

set

Set the full data using individual values.

function set(bytes32 key, MaterialId materialId, uint256 amount, uint256 cost) internal;

_set

Set the full data using individual values.

function _set(bytes32 key, MaterialId materialId, uint256 amount, uint256 cost) internal;

set

Set the full data using the data struct.

function set(bytes32 key, OfferData memory _table) internal;

_set

Set the full data using the data struct.

function _set(bytes32 key, OfferData 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 (MaterialId materialId, uint256 amount, uint256 cost);

decode

Decode the tightly packed blobs using this table's field layout.

function decode(bytes memory _staticData, EncodedLengths, bytes memory)
    internal
    pure
    returns (OfferData memory _table);

Parameters

NameTypeDescription
_staticDatabytesTightly 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(MaterialId materialId, uint256 amount, uint256 cost) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(MaterialId materialId, uint256 amount, uint256 cost)
    internal
    pure
    returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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);

OrderData

Git Source

struct OrderData {
    uint256 creationBlock;
    address creator;
    MaterialId materialId;
    uint256 amount;
    uint256 expirationBlock;
    uint256 reward;
    uint32 maxPlayers;
}

Order

Git Source

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

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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

NameTypeDescription
_staticDatabytesTightly 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

NameTypeDescription
<none>bytesThe 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

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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);

OutgoingConnections

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004f7574676f696e67436f6e6e65637469);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001c1000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32[] memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32[] memory value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32[] memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32[] memory value);

setValue

Set value.

function setValue(bytes32 id, bytes32[] memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32[] memory value) internal;

set

Set value.

function set(bytes32 id, bytes32[] memory value) internal;

_set

Set value.

function _set(bytes32 id, bytes32[] memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

pushValue

Push an element to value.

function pushValue(bytes32 id, bytes32 _element) internal;

_pushValue

Push an element to value.

function _pushValue(bytes32 id, bytes32 _element) internal;

push

Push an element to value.

function push(bytes32 id, bytes32 _element) internal;

_push

Push an element to value.

function _push(bytes32 id, bytes32 _element) internal;

popValue

Pop an element from value.

function popValue(bytes32 id) internal;

_popValue

Pop an element from value.

function _popValue(bytes32 id) internal;

pop

Pop an element from value.

function pop(bytes32 id) internal;

_pop

Pop an element from value.

function _pop(bytes32 id) internal;

updateValue

Update an element of value at _index.

function updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

_updateValue

Update an element of value at _index.

function _updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

update

Update an element of value at _index.

function update(bytes32 id, uint256 _index, bytes32 _element) internal;

_update

Update an element of value at _index.

function _update(bytes32 id, uint256 _index, bytes32 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes32[] memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes32[] memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32[] memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

ProducedMaterials

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000050726f64756365644d6174657269616c);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001af000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes14[] memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes14[] memory value);

get

Get value.

function get(bytes32 id) internal view returns (bytes14[] memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes14[] memory value);

setValue

Set value.

function setValue(bytes32 id, bytes14[] memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes14[] memory value) internal;

set

Set value.

function set(bytes32 id, bytes14[] memory value) internal;

_set

Set value.

function _set(bytes32 id, bytes14[] memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (bytes14);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (bytes14);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (bytes14);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (bytes14);

pushValue

Push an element to value.

function pushValue(bytes32 id, bytes14 _element) internal;

_pushValue

Push an element to value.

function _pushValue(bytes32 id, bytes14 _element) internal;

push

Push an element to value.

function push(bytes32 id, bytes14 _element) internal;

_push

Push an element to value.

function _push(bytes32 id, bytes14 _element) internal;

popValue

Pop an element from value.

function popValue(bytes32 id) internal;

_popValue

Pop an element from value.

function _popValue(bytes32 id) internal;

pop

Pop an element from value.

function pop(bytes32 id) internal;

_pop

Pop an element from value.

function _pop(bytes32 id) internal;

updateValue

Update an element of value at _index.

function updateValue(bytes32 id, uint256 _index, bytes14 _element) internal;

_updateValue

Update an element of value at _index.

function _updateValue(bytes32 id, uint256 _index, bytes14 _element) internal;

update

Update an element of value at _index.

function update(bytes32 id, uint256 _index, bytes14 _element) internal;

_update

Update an element of value at _index.

function _update(bytes32 id, uint256 _index, bytes14 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes14[] memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes14[] memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes14[] memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

Recipe

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000052656369706500000000000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x00210200005f0000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001af000000000000000000000000000000000000000000000000000000);

lengthOutputs

uint256 constant lengthOutputs = 2;

length

uint256 constant length = 2;

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getOutputs

Get outputs.

function getOutputs(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);

_getOutputs

Get outputs.

function _getOutputs(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);

get

Get outputs.

function get(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);

_get

Get outputs.

function _get(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);

setOutputs

Set outputs.

function setOutputs(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;

_setOutputs

Set outputs.

function _setOutputs(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;

set

Set outputs.

function set(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;

_set

Set outputs.

function _set(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;

getItemOutputs

Get an item of outputs.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);

_getItemOutputs

Get an item of outputs.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);

getItem

Get an item of outputs.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);

_getItem

Get an item of outputs.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);

updateOutputs

Update an element of outputs at _index.

function updateOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;

_updateOutputs

Update an element of outputs at _index.

function _updateOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;

update

Update an element of outputs at _index.

function update(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;

_update

Update an element of outputs at _index.

function _update(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(MACHINE_TYPE machineType, bytes32 input) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(MACHINE_TYPE machineType, bytes32 input) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes14[2] memory outputs) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes14[2] memory outputs) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes14[2] memory outputs) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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(MACHINE_TYPE machineType, bytes32 input) internal pure returns (bytes32[] memory);

toStaticArray_bytes14_2

Git Source

Cast a dynamic array to a static array.

In memory static arrays are just dynamic arrays without the 32 length bytes, so this function moves the pointer to the first element of the dynamic array. If the length of the dynamic array is smaller than the static length, the function returns an uninitialized array to avoid memory corruption.

function toStaticArray_bytes14_2(bytes14[] memory _value) pure returns (bytes14[2] memory _result);

Parameters

NameTypeDescription
_valuebytes14[]The dynamic array to cast.

Returns

NameTypeDescription
_resultbytes14[2]The static array.

fromStaticArray_bytes14_2

Git Source

Copy a static array to a dynamic array.

Static arrays don't have a length prefix, so this function copies the memory from the static array to a new dynamic array.

function fromStaticArray_bytes14_2(bytes14[2] memory _value) pure returns (bytes14[] memory _result);

Parameters

NameTypeDescription
_valuebytes14[2]The static array to copy.

Returns

NameTypeDescription
_resultbytes14[]The dynamic array.

SpawnIndex

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000537061776e496e646578000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0004010004000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0004010003000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint32 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint32 value);

get

Get value.

function get(bytes32 id) internal view returns (uint32 value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint32 value);

setValue

Set value.

function setValue(bytes32 id, uint32 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint32 value) internal;

set

Set value.

function set(bytes32 id, uint32 value) internal;

_set

Set value.

function _set(bytes32 id, uint32 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(uint32 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint32 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

TankConnection

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000054616e6b436f6e6e656374696f6e0000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32 value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32 value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32 value);

setValue

Set value.

function setValue(bytes32 id, bytes32 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32 value) internal;

set

Set value.

function set(bytes32 id, bytes32 value) internal;

_set

Set value.

function _set(bytes32 id, bytes32 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(bytes32 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

TanksInPod

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000054616e6b73496e506f64000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x00000001c1000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bytes32[] memory value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bytes32[] memory value);

get

Get value.

function get(bytes32 id) internal view returns (bytes32[] memory value);

_get

Get value.

function _get(bytes32 id) internal view returns (bytes32[] memory value);

setValue

Set value.

function setValue(bytes32 id, bytes32[] memory value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bytes32[] memory value) internal;

set

Set value.

function set(bytes32 id, bytes32[] memory value) internal;

_set

Set value.

function _set(bytes32 id, bytes32[] memory value) internal;

lengthValue

Get the length of value.

function lengthValue(bytes32 id) internal view returns (uint256);

_lengthValue

Get the length of value.

function _lengthValue(bytes32 id) internal view returns (uint256);

length

Get the length of value.

function length(bytes32 id) internal view returns (uint256);

_length

Get the length of value.

function _length(bytes32 id) internal view returns (uint256);

getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItemValue

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItemValue(bytes32 id, uint256 _index) internal view returns (bytes32);

getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

_getItem

Get an item of value.

Reverts with Store_IndexOutOfBounds if _index is out of bounds for the array.

function _getItem(bytes32 id, uint256 _index) internal view returns (bytes32);

pushValue

Push an element to value.

function pushValue(bytes32 id, bytes32 _element) internal;

_pushValue

Push an element to value.

function _pushValue(bytes32 id, bytes32 _element) internal;

push

Push an element to value.

function push(bytes32 id, bytes32 _element) internal;

_push

Push an element to value.

function _push(bytes32 id, bytes32 _element) internal;

popValue

Pop an element from value.

function popValue(bytes32 id) internal;

_popValue

Pop an element from value.

function _popValue(bytes32 id) internal;

pop

Pop an element from value.

function pop(bytes32 id) internal;

_pop

Pop an element from value.

function _pop(bytes32 id) internal;

updateValue

Update an element of value at _index.

function updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

_updateValue

Update an element of value at _index.

function _updateValue(bytes32 id, uint256 _index, bytes32 _element) internal;

update

Update an element of value at _index.

function update(bytes32 id, uint256 _index, bytes32 _element) internal;

_update

Update an element of value at _index.

function _update(bytes32 id, uint256 _index, bytes32 _element) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeLengths

Tightly pack dynamic data lengths using this table's schema.

function encodeLengths(bytes32[] memory value) internal pure returns (EncodedLengths _encodedLengths);

Returns

NameTypeDescription
_encodedLengthsEncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).

encodeDynamic

Tightly pack dynamic (variable length) data using this table's schema.

function encodeDynamic(bytes32[] memory value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe dynamic data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bytes32[] memory value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

Tutorial

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000005475746f7269616c0000000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0001010001000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0001010060000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (bool value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (bool value);

get

Get value.

function get(bytes32 id) internal view returns (bool value);

_get

Get value.

function _get(bytes32 id) internal view returns (bool value);

setValue

Set value.

function setValue(bytes32 id, bool value) internal;

_setValue

Set value.

function _setValue(bytes32 id, bool value) internal;

set

Set value.

function set(bytes32 id, bool value) internal;

_set

Set value.

function _set(bytes32 id, bool value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(bool value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(bool value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

_toBool

Git Source

Cast a value to a bool.

Boolean values are encoded as uint8 (1 = true, 0 = false), but Solidity doesn't allow casting between uint8 and bool.

function _toBool(uint8 value) pure returns (bool result);

Parameters

NameTypeDescription
valueuint8The uint8 value to convert.

Returns

NameTypeDescription
resultboolThe boolean value.

TutorialLevel

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000005475746f7269616c4c6576656c000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0004010004000000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x0004010003000000000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]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

NameTypeDescription
fieldNamesstring[]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;

getValue

Get value.

function getValue(bytes32 id) internal view returns (uint32 value);

_getValue

Get value.

function _getValue(bytes32 id) internal view returns (uint32 value);

get

Get value.

function get(bytes32 id) internal view returns (uint32 value);

_get

Get value.

function _get(bytes32 id) internal view returns (uint32 value);

setValue

Set value.

function setValue(bytes32 id, uint32 value) internal;

_setValue

Set value.

function _setValue(bytes32 id, uint32 value) internal;

set

Set value.

function set(bytes32 id, uint32 value) internal;

_set

Set value.

function _set(bytes32 id, uint32 value) internal;

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 id) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 id) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(uint32 value) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(uint32 value) internal pure returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe 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 id) internal pure returns (bytes32[] memory);

Contents

IBuildSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

buildMachine

function buildMachine(MACHINE_TYPE _machineType) external returns (bytes32 machineEntity);

IConnectSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

connect

function connect(bytes32 _sourceMachine, bytes32 _targetMachine, PORT_INDEX _portIndex) external;

IDestroySystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

removeMachine

function removeMachine(bytes32 _machineEntity) external;

IDevSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

devGraduate

function devGraduate(address _address) external;

devFillTank

function devFillTank(bytes32 _tankEntity, uint256 _amount, MaterialId _materialId) external;

devReward

function devReward(address _address) external;

IDisconnectSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

disconnect

function disconnect(bytes32 _sourceMachine, PORT_INDEX _portIndex) external;

IGraduateSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

graduate

function graduate() external pure;

IOfferSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

createOffer

function createOffer(MaterialId _materialId, uint256 _amount, uint256 _cost) external returns (bytes32 orderEntity);

cancelOffer

function cancelOffer(bytes32 _offerEntity) external;

buyOffer

function buyOffer(bytes32 _offerEntity) external;

IOrderSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

createOrder

function createOrder(MaterialId _materialId, uint256 _amount, uint256 _reward, uint32 _duration, uint32 _maxPlayers)
    external
    returns (bytes32 orderEntity);

cancelOrder

function cancelOrder(bytes32 _orderEntity) external;

acceptOrder

function acceptOrder(bytes32 _orderEntity) external;

unacceptOrder

function unacceptOrder() external;

IResolveSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

resolve

function resolve() external;

ISpawnSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

spawn

function spawn(string memory _name) external returns (bytes32 playerEntity);

IStartSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

start

function start() external returns (bytes32 podEntity);

ITankSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

plugTank

function plugTank(bytes32 _tankEntity, bytes32 _targetEntity) external;

unplugTank

function unplugTank(bytes32 _tankEntity) external;

emptyTank

function emptyTank(bytes32 _tankEntity) external;

shipTank

function shipTank(bytes32 _tankEntity) external;

ITokenTankSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

fillTank

function fillTank(bytes32 _tankEntity, uint256 _amount, MaterialId _materialId) external;

IWipeSystem

Git Source

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface is automatically generated from the corresponding system contract. Do not edit manually.

Functions

wipePod

function wipePod() external;

IWorld

Git Source

Inherits: IBaseWorld, IDevSystem, IBuildSystem, IConnectSystem, IDestroySystem, IDisconnectSystem, IResolveSystem, IWipeSystem, IOfferSystem, IOrderSystem, IGraduateSystem, ISpawnSystem, IStartSystem, ITankSystem, ITokenTankSystem

Author: MUD (https://mud.dev) by Lattice (https://lattice.xyz)

This interface integrates all systems and associated function selectors that are dynamically registered in the World during deployment.

This is an autogenerated file; do not edit manually.

ENTITY_TYPE

Git Source

enum ENTITY_TYPE {
    NONE,
    ORDER,
    OFFER,
    POD,
    MACHINE,
    TANK
}

MACHINE_TYPE

Git Source

enum MACHINE_TYPE {
    NONE,
    INLET,
    OUTLET,
    PLAYER,
    SPLITTER,
    MIXER,
    DRYER,
    BOILER,
    CENTRIFUGE,
    GRINDER,
    RAT_CAGE,
    MEALWORM_VAT
}

PORT_INDEX

Git Source

enum PORT_INDEX {
    FIRST,
    SECOND
}

MATERIAL_DIFFICULTY

Git Source

enum MATERIAL_DIFFICULTY {
    NOVICE,
    INTERMEDIATE,
    ADVANCED,
    NIGHTMARE
}

Contents

Contents

LibAddRecipe

Git Source

Functions

player

function player(MaterialId _input, MaterialId[2] memory _output) internal;

mixer

function mixer(MaterialId[2] memory _input, MaterialId _output) internal;

dryer

function dryer(MaterialId _input, MaterialId _output) internal;

boiler

function boiler(MaterialId _input, MaterialId _output) internal;

centrifuge

function centrifuge(MaterialId _input, MaterialId[2] memory _output) internal;

grinder

function grinder(MaterialId _input, MaterialId[2] memory _output) internal;

ratCage

function ratCage(MaterialId _input, MaterialId[2] memory _output) internal;

mealwormVat

function mealwormVat(MaterialId _input, MaterialId[2] memory _output) internal;

_requireRegistered

function _requireRegistered(MaterialId _materialId) private view;

_requireRegistered

function _requireRegistered(MaterialId[2] memory _materialIds) private view;

_parseInput

function _parseInput(MaterialId _materialId) private view returns (bytes32);

_parseInput

function _parseInput(MaterialId[2] memory _materialIds) private view returns (bytes32);

_parseOutput

function _parseOutput(MaterialId _materialId) private view returns (bytes14[2] memory _result);

_parseOutput

function _parseOutput(MaterialId[2] memory _materialIds) private view returns (bytes14[2] memory _result);

LibInit

Git Source

Functions

init

Set game config and create tutorial orders

function init(address _adminAddress) internal;

Parameters

NameTypeDescription
_adminAddressaddressThe address of the admin

LibInitRecipes

Git Source

Functions

init

Create recipes needed for tutorial

function init() internal;

PublicMaterials

Git Source

State Variables

BUGS

MaterialId constant BUGS = MaterialId.wrap("t_BUGS");

PISS

MaterialId constant PISS = MaterialId.wrap("t_PISS");

BLOOD

MaterialId constant BLOOD = MaterialId.wrap("t_BLOOD");

HEMATURIC_FLUID

MaterialId constant HEMATURIC_FLUID = MaterialId.wrap("t_HEMA");

DUST

MaterialId constant DUST = MaterialId.wrap("t_DUST");

UREA

MaterialId constant UREA = MaterialId.wrap("t_UREA");

FERTILIZER

MaterialId constant FERTILIZER = MaterialId.wrap("t_FRTL");

AMPHETAMINE

MaterialId constant AMPHETAMINE = MaterialId.wrap("t_SPEED");

BLOOD_CLOTS

MaterialId constant BLOOD_CLOTS = MaterialId.wrap("t_CLOT");

BLOOD_MEAL

MaterialId constant BLOOD_MEAL = MaterialId.wrap("t_BML");

ORGANIC_WASTE

MaterialId constant ORGANIC_WASTE = MaterialId.wrap("t_ORW");

FAT

MaterialId constant FAT = MaterialId.wrap("t_FAT");

LUBRICANT

MaterialId constant LUBRICANT = MaterialId.wrap("t_LUBE");

WATER

MaterialId constant WATER = MaterialId.wrap("t_H20");

Functions

init

function init() internal;

LibEntity

Git Source

Functions

create

Creates a new machine entity of the specified type.

function create(MACHINE_TYPE _machineType) internal returns (bytes32);

Parameters

NameTypeDescription
_machineTypeMACHINE_TYPEThe type of machine to create

Returns

NameTypeDescription
<none>bytes32entity The identifier for the newly created machine entity.

remove

Deletes the records associated with a specified entity.

function remove(bytes32 _podEntity, bytes32 _entity) internal;

Parameters

NameTypeDescription
_podEntitybytes32The identifier for the pod entity that the machine entity is associated with.
_entitybytes32The identifier for the entity whose records are to be deleted.

isBuildableMachineType

Checks if the specified machine type is buildable

function isBuildableMachineType(MACHINE_TYPE _machineType) internal pure returns (bool);

Parameters

NameTypeDescription
_machineTypeMACHINE_TYPEThe type of machine to verify

Returns

NameTypeDescription
<none>boolbool True if the machine type is among the predefined buildable types, false otherwise.

LibMachine

Git Source

Functions

process

Routes the input products to functions handeling the specific machine type, returning the output products.

function process(MACHINE_TYPE _machineType, Product[] memory _inputs)
    internal
    view
    returns (Product[] memory _output);

Parameters

NameTypeDescription
_machineTypeMACHINE_TYPEThe type of the machine to process the products.
_inputsProduct[]An array of products to be processed.

Returns

NameTypeDescription
_outputProduct[]An array of resultant products after processing.

splitter

Splits a single input product into two output products of equal amount.

function splitter(Product memory _input) internal pure returns (Product[] memory _outputs);

Parameters

NameTypeDescription
_inputProductProduct to be processed.

Returns

NameTypeDescription
_outputsProduct[]An array containing two products

mixer

Mixes two input products, transforming them into a single output product based on a recipe

Amount returned will be the lowest of the two inputs

function mixer(Product[] memory _inputs) internal view returns (Product[] memory _outputs);

Parameters

NameTypeDescription
_inputsProduct[]An array of products

Returns

NameTypeDescription
_outputsProduct[]An array of products

defaultMachine

Processes a singleinput product through a specified machine type, creating one ot two output product.

function defaultMachine(MACHINE_TYPE _machineType, Product memory _input)
    internal
    view
    returns (Product[] memory _outputs);

Parameters

NameTypeDescription
_machineTypeMACHINE_TYPEThe type of machine to process the input product.
_inputProductInput product

Returns

NameTypeDescription
_outputsProduct[]An array of output products

getLowestAmountProduct

function getLowestAmountProduct(Product memory _A, Product memory _B)
    internal
    pure
    returns (Product memory _lowestAmountProduct);

MaterialId

Git Source

type MaterialId is bytes14;

LibMaterial

Git Source

State Variables

NONE

MaterialId constant NONE = MaterialId.wrap(bytes14(0));

Functions

registerMaterial

function registerMaterial(
    MaterialId _materialId,
    string memory _name,
    string memory _symbol,
    MATERIAL_DIFFICULTY _difficulty
) internal;

mint

Mint token to address

function mint(MaterialId _materialId, address _to, uint256 _value) internal;

Parameters

NameTypeDescription
_materialIdMaterialIdmaterial id to mint
_toaddressaddress to mint to
_valueuint256amount to mint

burn

Burn token from address

function burn(MaterialId _materialId, address _to, uint256 _value) internal;

Parameters

NameTypeDescription
_materialIdMaterialIdmaterial id to burn
_toaddressaddress to burn from
_valueuint256amount to burn

transferToken

Transfer tokens

function transferToken(MaterialId _materialId, address _to, uint256 _value) internal;

Parameters

NameTypeDescription
_materialIdMaterialId
_toaddressaddress to transfer to
_valueuint256amount to transfer

getTokenBalance

Get token balance for an account

function getTokenBalance(MaterialId _materialId, address _account) internal view returns (uint256);

Parameters

NameTypeDescription
_materialIdMaterialId
_accountaddressaddress to get balance for

getMaterialCombinationId

Get id for a combination of 1 material

function getMaterialCombinationId(MaterialId _a) internal pure returns (bytes32);

Parameters

NameTypeDescription
_aMaterialIdMaterial id

getMaterialCombinationId

Get id for a combination of 2 materials

function getMaterialCombinationId(MaterialId _a, MaterialId _b) internal pure returns (bytes32);

Parameters

NameTypeDescription
_aMaterialIdMaterial id
_bMaterialIdMaterial id

isRegistered

Whether the material has been registered

function isRegistered(MaterialId _materialId) internal view returns (bool);

unwrap

function unwrap(MaterialId _materialId) internal pure returns (bytes14);

ne

Git Source

function ne(MaterialId _a, MaterialId _b) pure returns (bool);

eq

Git Source

function eq(MaterialId _a, MaterialId _b) pure returns (bool);

LibNetwork

Git Source

Functions

resolve

Resolve the network in a pod

The outcome of this function is to update the tanks in the pod

function resolve(bytes32 _podEntity) internal;

Parameters

NameTypeDescription
_podEntitybytes32The id of the pod entity

Structs

Counters

struct Counters {
    uint32 iterations;
    uint32 resolved;
    uint32 inputs;
}

LibOffer

Git Source

Functions

create

Create a new offer

function create(MaterialId _materialId, uint256 _amount, uint256 _cost) internal returns (bytes32 offerEntity);

Parameters

NameTypeDescription
_materialIdMaterialIdMaterial id of the offer
_amountuint256Amount of material in the offer in whole units
_costuint256Cost of the offer in whole units

Returns

NameTypeDescription
offerEntitybytes32The id of the offer entity.

destroy

Destroy an offer

function destroy(bytes32 _offerEntity) internal;

Parameters

NameTypeDescription
_offerEntitybytes32Id of the offer entity

LibOrder

Git Source

Functions

create

Create a new order

function create(
    address _creator,
    MaterialId _materialId,
    uint256 _amount,
    bool _isTutorial,
    uint32 _tutorialLevel,
    uint256 _reward,
    uint32 _duration,
    uint32 _maxPlayers
) internal returns (bytes32);

Parameters

NameTypeDescription
_creatoraddressCreator of the order
_materialIdMaterialIdMaterial id to be produced
_amountuint256Amount of material to be produced in whole units
_isTutorialboolIs the order a tutorial order
_tutorialLeveluint32Tutorial level of the order
_rewarduint256Reward for completing the order in whole units
_durationuint32Duration of the order
_maxPlayersuint32Maximum number of players that can complete the order

cancel

Cancel an order

function cancel(bytes32 _orderEntity) internal;

Parameters

NameTypeDescription
_orderEntitybytes32Order to remove

LibPod

Git Source

Functions

create

Create a new pod

function create() internal returns (bytes32 podEntity);

Returns

NameTypeDescription
podEntitybytes32The id of the pod entity.

setMachineBuildIndex

Increments global (for all machines in the pod) build index, and sets it for the given machine

function setMachineBuildIndex(bytes32 _podEntity, MACHINE_TYPE _machineType, bytes32 _machineEntity) internal;

Parameters

NameTypeDescription
_podEntitybytes32The identifier for the pod entity.
_machineTypeMACHINE_TYPEThe type of machine being used.
_machineEntitybytes32The identifier for the machine entity.

LibTank

Git Source

Functions

create

Create a new tank

function create(bytes32 _podEntity, uint32 _index) internal returns (bytes32 tankEntity);

Parameters

NameTypeDescription
_podEntitybytes32The id of the pod entity
_indexuint32

Returns

NameTypeDescription
tankEntitybytes32The id of the tank entity

write

Update tanks based on the result of a network resolution

function write(
    bytes32[2] memory _inletTankEntities,
    bytes32 _outletTankEntity,
    uint256 _blocksSinceLastResolution,
    Product memory _output
) internal;

Parameters

NameTypeDescription
_inletTankEntitiesbytes32[2]The ids of the inlet tank entities
_outletTankEntitybytes32The id of the outlet tank entity
_blocksSinceLastResolutionuint256The number of blocks since the last resolution
_outputProductThe output product of the outlet

findLowestValue

Find the struct with the lowest amount in an array of structs

function findLowestValue(InletTankAmount[] memory inletTankAmounts) internal pure returns (InletTankAmount memory);

Parameters

NameTypeDescription
inletTankAmountsInletTankAmount[]The array of structs to search

Returns

NameTypeDescription
<none>InletTankAmountThe struct with the lowest amount

getUsedInletTanks

Get tanks that are connected to inlets that contribute to the final output

Based on the flags (_inletActive) set on the outlet product struct

function getUsedInletTanks(bool[2] memory _inletActive, bytes32[2] memory _inletTankEntities)
    internal
    view
    returns (InletTankAmount[] memory);

Parameters

NameTypeDescription
_inletActivebool[2]The array of bools indicating if the inlets are active
_inletTankEntitiesbytes32[2]The array of inlet tank entities

Returns

NameTypeDescription
<none>InletTankAmount[]An array of structs of used tanks

Structs

InletTankAmount

struct InletTankAmount {
    uint32 index;
    uint256 amount;
}

LibUtils

Git Source

Functions

random

simple rng calculation

complexity needs to be increased in prod

function random(uint256 r1, uint256 r2) internal view returns (uint256 r);

Parameters

NameTypeDescription
r1uint256first source of randomness
r2uint256second source of randomness

Returns

NameTypeDescription
ruint256random value

max

Returns the largest of two numbers.

function max(int32 a, int32 b) internal pure returns (int32);

min

Returns the smallest of two numbers.

function min(int32 a, int32 b) internal pure returns (int32);

clamp

Clamps return value to _upperBound

function clamp(uint256 _value, uint256 _upperBound) internal pure returns (uint256);

Parameters

NameTypeDescription
_valueuint256value to be clamped
_upperBounduint256upper bound

Returns

NameTypeDescription
<none>uint256clamped value

abs

Returns the absolute value

function abs(int32 x) internal pure returns (int32);

absDif

Returns the absolute difference

function absDif(int32 a, int32 b) internal pure returns (uint32);

addressToEntityKey

Conversion from address to bytes32

function addressToEntityKey(address _address) internal pure returns (bytes32 key);

removeFromArray

Removes an element from an array of bytes32 if it exists and returns the new array.

function removeFromArray(bytes32[] memory array, bytes32 element) internal pure returns (bytes32[] memory);

Parameters

NameTypeDescription
arraybytes32[]The original array of bytes32 elements.
elementbytes32The bytes32 element to be removed from the array.

Returns

NameTypeDescription
<none>bytes32[]newArray The new array containing all elements of the original array except for the removed element.

stringEq

Checks equality of two strings

function stringEq(string memory a, string memory b) internal pure returns (bool);

safeSubtract

Subtract without underflow

function safeSubtract(uint256 a, uint256 b) internal pure returns (uint256);

arrayIncludes

Check if an element is included in an array

function arrayIncludes(bytes14[] memory array, bytes14 element) internal pure returns (bool);

Parameters

NameTypeDescription
arraybytes14[]The array to check
elementbytes14The element to check for

LibWipe

Git Source

Functions

wipe

Wipes pod network

Remove all machines excvept fixed ones. Remove all connections and tank attachements

function wipe(bytes32 _podEntity) internal;

Parameters

NameTypeDescription
_podEntitybytes32Pod entity

Contents

Contents

DevSystem

Git Source

Inherits: System

Functions

devGraduate

Fast forward player out of tutorial, minting tokens to the player

ONLY USED FOR TESTING.

function devGraduate(address _address) public;

Parameters

NameTypeDescription
_addressaddressAddress of the player

devFillTank

Fill tank with material

ONLY USED FOR TESTING.

function devFillTank(bytes32 _tankEntity, uint256 _amount, MaterialId _materialId) public;

Parameters

NameTypeDescription
_tankEntitybytes32Id of tank entity
_amountuint256Amount of material in whole units
_materialIdMaterialIdMaterial id of the material

devReward

Mint 1000 BUG tokens to the address

ONLY USED FOR TESTING.

function devReward(address _address) public;

Parameters

NameTypeDescription
_addressaddressAddress to mint to

Contents

BuildSystem

Git Source

Inherits: System

Functions

buildMachine

Build a machine

function buildMachine(MACHINE_TYPE _machineType) public returns (bytes32 machineEntity);

Parameters

NameTypeDescription
_machineTypeMACHINE_TYPEThe type of machine to build

Returns

NameTypeDescription
machineEntitybytes32The identifier for the newly created machine entity.

ConnectSystem

Git Source

Inherits: System

Functions

connect

Connect source machine to target machine on a specified port

Resolves network

function connect(bytes32 _sourceMachine, bytes32 _targetMachine, PORT_INDEX _portIndex) public;

Parameters

NameTypeDescription
_sourceMachinebytes32The id for the source machine.
_targetMachinebytes32The id for the target machine.
_portIndexPORT_INDEXThe port index on the source machine which determines the position (FIRST or SECOND) to write in the outgoing connections array.

DestroySystem

Git Source

Inherits: System

Functions

removeMachine

Removes a machine and clean up all its connections.

function removeMachine(bytes32 _machineEntity) public;

Parameters

NameTypeDescription
_machineEntitybytes32The id for the machine entity to be removed

_removeOutgoingConnection

function _removeOutgoingConnection(bytes32 _sourceMachine, bytes32 _connectedMachine) internal;

_removeIncomingConnection

function _removeIncomingConnection(bytes32 _targetMachine, bytes32 _connectedMachine) internal;

DisconnectSystem

Git Source

Inherits: System

Functions

disconnect

Disconnects machine on a specified port.

function disconnect(bytes32 _sourceMachine, PORT_INDEX _portIndex) public;

Parameters

NameTypeDescription
_sourceMachinebytes32The id for the source machine.
_portIndexPORT_INDEXThe port index on the source machine which determines which connection to disconnect.

_removeIncomingConnection

function _removeIncomingConnection(bytes32 _targetMachine, bytes32 _connectedMachine)
    internal
    returns (bool disconnected);

ResolveSystem

Git Source

Inherits: System

Functions

resolve

Manually resolve network in pod

Mostly used for testing purposes.

function resolve() public;

WipeSystem

Git Source

Inherits: System

Functions

wipePod

Wipe pod

Remove all machines, connections and tank attachments. Resolves network

function wipePod() public;

Contents

OfferSystem

Git Source

Inherits: System

Functions

createOffer

Create an offer

Restricted to admin

function createOffer(MaterialId _materialId, uint256 _amount, uint256 _cost) public returns (bytes32 orderEntity);

Parameters

NameTypeDescription
_materialIdMaterialIdMaterial id of the offer
_amountuint256Amount of material in whole units
_costuint256Cost of the offer in whole units

Returns

NameTypeDescription
orderEntitybytes32Id of the offer entity

cancelOffer

Cancel an offer

Restricted to admin

function cancelOffer(bytes32 _offerEntity) public;

Parameters

NameTypeDescription
_offerEntitybytes32Id of the offer entity

buyOffer

Buy an offer

Resolves network after buying

function buyOffer(bytes32 _offerEntity) public;

Parameters

NameTypeDescription
_offerEntitybytes32Id of the offer entity

OrderSystem

Git Source

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

NameTypeDescription
_materialIdMaterialIdMaterial id to produce
_amountuint256Amount to produce in whole units
_rewarduint256Reward for completing the order in whole units
_durationuint32Duration of the order. 0 means no expiration
_maxPlayersuint32Maximum number of players that can accept the order

Returns

NameTypeDescription
orderEntitybytes32Id of the offer entity

cancelOrder

Cancel an order

Restricted to admin

function cancelOrder(bytes32 _orderEntity) public;

Parameters

NameTypeDescription
_orderEntitybytes32Id 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

NameTypeDescription
_orderEntitybytes32Id of the order entity

unacceptOrder

Unaccept the current order

function unacceptOrder() public;

Contents

GraduateSystem

Git Source

Inherits: System

Functions

graduate

Fast forward out of tutorial

function graduate() public pure;

SpawnSystem

Git Source

Inherits: System

Functions

spawn

Spawn a player

function spawn(string memory _name) public returns (bytes32 playerEntity);

Returns

NameTypeDescription
playerEntitybytes32Id of player entity

StartSystem

Git Source

Inherits: System

Functions

start

Set up a pod for the player

function start() public returns (bytes32 podEntity);

Returns

NameTypeDescription
podEntitybytes32Id of pod entity

Contents

TankSystem

Git Source

Inherits: System

Functions

plugTank

Plug in a tank to inlet or outlet

Resolves network

function plugTank(bytes32 _tankEntity, bytes32 _targetEntity) public;

Parameters

NameTypeDescription
_tankEntitybytes32Id of tank entity
_targetEntitybytes32Id of inlet or outlet entity

unplugTank

Unplug a tank from inlet or outlet

Resolves network

function unplugTank(bytes32 _tankEntity) public;

Parameters

NameTypeDescription
_tankEntitybytes32Id of tank entity

emptyTank

Empty a tank

function emptyTank(bytes32 _tankEntity) public;

Parameters

NameTypeDescription
_tankEntitybytes32Id of tank entity

shipTank

Ship a tank to fulfill an order

Compares the tank to the current order goals and complete the order if goals are met

function shipTank(bytes32 _tankEntity) public;

Parameters

NameTypeDescription
_tankEntitybytes32Id of the tank entity

TokenTankSystem

Git Source

Inherits: System

Functions

fillTank

Convert material tokens to fill tank

function fillTank(bytes32 _tankEntity, uint256 _amount, MaterialId _materialId) public;

Parameters

NameTypeDescription
_tankEntitybytes32Id of tank entity
_amountuint256Amount of material in whole units
_materialIdMaterialIdMaterial id of the material

Constants

Git Source

NUMBER_OF_TUTORIAL_LEVELS

uint32 constant NUMBER_OF_TUTORIAL_LEVELS = 3;

ONE_UNIT

Material amounts and token have 18 decimals

uint256 constant ONE_UNIT = 1e18;

ONE_MINUTE

uint32 constant ONE_MINUTE = 60;

ONE_HOUR

uint32 constant ONE_HOUR = 60 * 60;

ONE_DAY

uint32 constant ONE_DAY = 24 * ONE_HOUR;

POD_MACHINE_CAPACITY

Four fixed machines and ten buildable machines

uint32 constant POD_MACHINE_CAPACITY = 14;

NUMBER_OF_TANKS

uint32 constant NUMBER_OF_TANKS = 3;

FLOW_RATE

The base rate of material pushed trough the network per block

uint256 constant FLOW_RATE = 10 * ONE_UNIT;

TANK_CAPACITY

uint256 constant TANK_CAPACITY = 500 * ONE_UNIT;

Product

Git Source

inletActive is used to determine which of the two inlets contributed to the final product

struct Product {
    bytes32 machineId;
    MaterialId materialId;
    uint256 amount;
    bool[2] inletActive;
}