This document provides an overview of the tables affected by various functions within the SpawnSystem contract. Each section describes the function, the affected tables, and the values set in those tables.
function commitSpawn(bytes32 _commitHash, bytes32 _matchEntity) public;- MatchPlayer: Retrieves the player entity for the given match and sender address.
- Key:
matchEntity,playerEntity - Value: The player entity associated with the sender address.
- Key:
- SpawnStatus: Sets the spawn status to
LockCommitSpawning.- Key:
matchEntity,playerEntity - Value:
SpawnStatusTypes.LockCommitSpawning
- Key:
- Commit: Stores the commit hash for the player.
- Key:
matchEntity,playerEntity - Value: The commit hash for the player.
- Key:
- Commits the player's spawning intentions by setting the commit hash and updating the spawn status to
LockCommitSpawning.
function revealSpawn(
bytes32 _matchEntity,
PositionData[] calldata _coordinates,
bytes32[] calldata _pieceEntities,
bytes32 _secret
) public;- EntityAtPosition: Adds the piece entities to the match at the specified positions.
- Key:
matchEntity,position - Value: The entity at the specified position.
- Key:
- Position: Updates the positions of the piece entities.
- Key:
pieceEntity - Value: The new position of the piece entity.
- Key:
- SpawnStatus: Sets the spawn status to
LockRevealSpawning.- Key:
matchEntity,playerEntity - Value:
SpawnStatusTypes.LockRevealSpawning
- Key:
- Reveals the player's committed spawn positions by validating the secret and updating the positions and piece entities on the board.