Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fog of war mechanic (Bandit) #1

Merged
merged 13 commits into from
Apr 9, 2024
Merged

Fog of war mechanic (Bandit) #1

merged 13 commits into from
Apr 9, 2024

Conversation

zomglings
Copy link
Contributor

This pull request introduces the single player fog of war mechanic that we will be using in The Degen Trail.

error WaitForNFTTick(address tokenAddress, uint256 tokenID);
error NFTNotOwnedByPlayer(address player, address tokenAddress, uint256 tokenID);

function _preRollForNFT(address tokenAddress, uint256 tokenID) internal virtual {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there also be a preRollForPlayer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment clarifying why there isn't symmetry between player and NFT - NFT has preroll, but player doesn't.

vm.roll(block.number + blockDeadline + 1);
vm.expectRevert(abi.encodeWithSelector(Bandit.NFTDeadlineExceeded.selector, address(nfts), tokenID));
bandit.resolveForNFT(address(nfts), tokenID);
vm.stopPrank();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test supposed to rerollForNFT ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, fixed.

Copy link

@kellan-simiotics kellan-simiotics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg

@zomglings zomglings merged commit b050273 into main Apr 9, 2024
1 check passed
@zomglings zomglings deleted the fog branch April 9, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants