Add Contract logic to set the MancalaGame state winner after the game is completed.
Closed this issue ยท 8 comments
The MancalaGame model is defined like this:
#[derive(Model, Copy, Drop, Serde, Debug)] struct MancalaGame { #[key] game_id: u128, player_one: ContractAddress, player_two: ContractAddress, current_player: ContractAddress, winner: ContractAddress, // todo implement logic to set this state is_finished: bool, }
When a game is finished, marked by one of the players having all of their pits emptied, add logic to set the state of the winner = to the winner of the game
Add Unit tests to ensure this is working correctly.
@web3technologies @okhaimie-dev Kindly let me have a crack at this ๐
@web3technologies @okhaimie-dev Kindly let me have a crack at this ๐
All you!
@web3technologies @okhaimie-dev Kindly let me have a crack at this ๐
I updated the description but be sure to add some unit testing!
@mul1sh How's progress on this? Do you need any assistance?
@mul1sh How's progress on this? Do you need any assistance?
Naah i'm good ๐ Had to revisit the dojo docs 1 more time, pushing a PR in a few hours
@web3technologies I think this issue was actually fixed in this commit if i'm not wrong ๐ค
Just realized this as I was rebasing my local changes inorder to PR
Yes that is correct
Closed per this commit: 9e85a1a