-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: GameSystem.sol spilt three system
- Loading branch information
lewis
committed
Oct 8, 2023
1 parent
ed40efc
commit 39df443
Showing
19 changed files
with
743 additions
and
943 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
node_modules | ||
packages/contracts/src/codegen/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.0; | ||
|
||
import {console} from "forge-std/console.sol"; | ||
import {IWorld} from "../src/codegen/world/IWorld.sol"; | ||
import {BattleConfig} from "../src/codegen/Tables.sol"; | ||
import { BATTLE_CONFIG_KEY } from "../src/Constants.sol"; | ||
|
||
library BattleConfigInit { | ||
function initGameConfig(IWorld _world) internal { | ||
address[] memory players; | ||
BattleConfig.set( | ||
_world, | ||
BATTLE_CONFIG_KEY, //key | ||
10, //maxAttackzDistance | ||
15, //maxMoveDistance, | ||
120, //maxTimeLimit, | ||
120, //maxUserLocationLockTime, | ||
120, //maxBoxBindTime, | ||
players | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.0; | ||
|
||
import {console} from "forge-std/console.sol"; | ||
import {IWorld} from "../src/codegen/world/IWorld.sol"; | ||
import {GameConfig} from "../src/codegen/Tables.sol"; | ||
import { GAME_CONFIG_KEY } from "../src/Constants.sol"; | ||
|
||
library GameConfigInit { | ||
function initGameConfig(IWorld _world) internal { | ||
bytes32 merkleRoot = ""; | ||
GameConfig.set( | ||
_world, | ||
GAME_CONFIG_KEY, //key | ||
merkleRoot, //merkleRoot | ||
0, //battleId, | ||
0, //randomId, | ||
100, //originX, | ||
100, //originY, | ||
0, //roomId, | ||
0 //boxId, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.0; | ||
|
||
bytes32 constant GAME_CONFIG_KEY = keccak256("Game-Key"); | ||
bytes32 constant BATTLE_CONFIG_KEY = keccak256("Battle-Key"); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.