Skip to content

Commit

Permalink
getters
Browse files Browse the repository at this point in the history
  • Loading branch information
dhvanipa committed May 11, 2024
1 parent df9d79f commit a34df2d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/hardhat/contracts/Game.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { IWorld } from "@biomesaw/world/src/codegen/world/IWorld.sol";
import { VoxelCoord } from "@biomesaw/utils/src/Types.sol";
import { getObjectType, getEntityAtCoord, getPosition, getEntityFromPlayer, getObjectTypeAtCoord } from "../utils/EntityUtils.sol";
import { voxelCoordsAreEqual } from "@biomesaw/utils/src/VoxelCoordUtils.sol";
import { NamedBuild } from "../utils/GameUtils.sol";

struct NamePair {
uint256 id;
Expand Down Expand Up @@ -330,4 +331,16 @@ contract Game is IOptionalSystemHook {
function getEarned() public view returns (uint256) {
return earned[msg.sender];
}

function getDisplayName() external view returns (string memory) {
return "Build A Nomics";
}

function getBuilds() external view returns (NamedBuild[] memory) {
NamedBuild[] memory builds = new NamedBuild[](buildCount);
for (uint256 i = 1; i <= buildCount; i++) {
builds[i - 1] = NamedBuild({ name: names[i], build: blueprints[i] });
}
return builds;
}
}

0 comments on commit a34df2d

Please sign in to comment.