This document provides an overview of the tables affected by various functions within the BuySystem contract. Each section describes the function, the affected tables, and the values set in those tables.
function commitBuy(bytes32 _commitHash, bytes32 _matchEntity) public;- MatchPlayer: Sets 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
LockCommitBuying.- Key:
matchEntity,playerEntity - Value:
SpawnStatusTypes.LockCommitBuying
- Key:
- Commit: Stores the commit hash for the player.
- Key:
matchEntity,playerEntity - Value: The commit hash for the player.
- Key:
- Commits the player's purchase intentions by setting the commit hash and updating the spawn status to
LockCommitBuying.
function revealBuy(bytes32 _matchEntity, uint256[] memory _pieceTypes, bytes32 _secret) public;- Inventory: Updates the player's inventory balance and purchased pieces.
- Key:
matchEntity,playerEntity - Value: The updated inventory balance and pieces.
- Key:
- Piece: Adds the purchased pieces to the match.
- Key:
matchEntity,pieceEntity - Value: The piece entity added to the match.
- Key:
- Battle: Sets the battle attributes for the purchased pieces.
- Key:
matchEntity,pieceEntity - Value: The battle attributes for the piece.
- Key:
- Movement: Sets the movement attributes for the purchased pieces.
- Key:
matchEntity,pieceEntity - Value: The movement attributes for the piece.
- Key:
- OwnedBy: Sets the ownership of the purchased pieces.
- Key:
matchEntity,pieceEntity - Value: The ownership information of the piece.
- Key:
- PrimaryPiece: Marks the purchased pieces as primary if applicable.
- Key:
matchEntity,pieceEntity - Value:
trueif the piece is primary, otherwisefalse.
- Key:
- MatchEntityCounter: Increments the entity counter for the match.
- Key:
matchEntity - Value: The updated entity counter.
- Key:
- Reveals the player's committed purchases by validating the secret and updating the player's inventory and purchased pieces.