/**
Implements game logic and board's features
function constructor(
address _VRFCoordinator,
address _LinkToken,
bytes32 _keyHash,
uint256 _Chainlinkfee
) public
Constructor
Name |
Type |
Description |
_VRFCoordinator |
address |
ChainLink VRFCoordinator contract address |
_LinkToken |
address |
LINK token address |
_keyHash |
bytes32 |
ChainLink keyHash parameter for VRF |
_Chainlinkfee |
uint256 |
ChainLink fee for VRF*/ |
function requestRandomNumber(
) internal returns (bytes32 requestId)
- @dev Request a random number
Name |
Type |
Description |
requestId |
|
the id of the request for the oracle*/ |
function fulfillRandomness(
bytes32 requestId,
uint256 randomness
) internal
Callback function used by ChainLink VRF Coordinator
/!\ Maximum Gas for Callback : If your fulfillRandomness function uses more than 200k gas, the transaction will fail.*/
Name |
Type |
Description |
requestId |
bytes32 |
the id of the request for the oracle |
randomness |
uint256 |
randomness must be requested from an oracle, which generates a number and a cryptographic proof |
function gameStrategist(
uint16 _edition,
uint256 _pawnID
) internal
Name |
Type |
Description |
_edition |
uint16 |
board edition |
_pawnID |
uint256 |
pawn ID*/ |
function isPurchasable(
uint16 edition,
uint8 land
) external returns (bool)
- check if a land can be bought (PROP tokens available)
Name |
Type |
Description |
edition |
uint16 |
board edition |
land |
uint8 |
cell number |
Name |
Type |
Description |
true |
uint16 |
or false*/ |
function getMaxEdition(
) external returns (uint16)
- get the number of board editions
Name |
Type |
Description |
number |
|
of board editions*/ |
function getNbLands(
uint16 edition
) external returns (uint8)
- get the number of lands for a board edition
Name |
Type |
Description |
edition |
uint16 |
board edition |
Name |
Type |
Description |
number |
uint16 |
of lands*/ |
function getRarityLevel(
uint16 edition
) external returns (uint8)
- get the number of rarity level for a board edition
Name |
Type |
Description |
edition |
uint16 |
board edition |
Name |
Type |
Description |
number |
uint16 |
of rarity levels*/ |
function newBoard(
uint8 _nbOfLands,
uint8 _rarityLevel,
uint8[] _maxPawns
) public
Name |
Type |
Description |
_nbOfLands |
uint8 |
number of lands |
_rarityLevel |
uint8 |
number of rarity levels |
_maxPawns |
uint8[] |
max number of pawns allowed*/ |
function register(
uint16 _edition,
uint256 _pawnID
) external returns (bool isOnBoarded)
- register a pawn on a board
Name |
Type |
Description |
_edition |
uint16 |
board edition |
_pawnID |
uint256 |
pawn ID*/ |
function isRegistered(
uint16 _edition,
uint256 _pawnID
) public returns (bool)
- check if a pawn is registered
Name |
Type |
Description |
_edition |
uint16 |
board edition |
_pawnID |
uint256 |
pawn ID |
Name |
Type |
Description |
true |
uint16 |
or false*/ |
function play(
uint16 _edition,
uint256 _pawnID
) external returns (bytes32 requestId)
Name |
Type |
Description |
_edition |
uint16 |
board edition |
_pawnID |
uint256 |
pawn ID*/ |
function getPawnInfo(
uint16 _edition,
uint256 _pawnID
) external returns (struct BoardContract.PawnInfo p)
- get Pawn information on a board
Name |
Type |
Description |
_edition |
uint16 |
board edition |
_pawnID |
uint256 |
pawn ID |
Name |
Type |
Description |
p |
uint16 |
Pawn information*/ |
function setPawnInfo(
uint16 _edition,
uint256 _pawnID,
struct BoardContract.PawnInfo _pawnInfo
) external
- set Pawn information on a board
Name |
Type |
Description |
_edition |
uint16 |
board edition |
_pawnID |
uint256 |
pawn ID |
_pawnInfo |
struct BoardContract.PawnInfo |
pawn information*/ |
event BoardCreated(
uint16 new_edition_nb
)
- Event emitted when a new board is created
Name |
Type |
Description |
new_edition_nb |
uint16 |
new board edition number*/ |
event ePawn(
uint16 _edition,
uint256 _pawnID
)
- Event emitted when a new pawn is registered on a board
Name |
Type |
Description |
_edition |
uint16 |
board edition number |
_pawnID |
uint256 |
pawn's ID*/ |
event RandomReady(
bytes32 requestId
)
Event emitted when a random number is received by contract
see fulfillRandomness()*/
Name |
Type |
Description |
requestId |
bytes32 |
request id |