I am trying to delete all the players that played a turn in a game. The contract is not meant to permanently store a list of players, it simply keeps track of players that have played in the current turn. Player status is held in a struct, however deleting the struct inside a mapping does not work. how do I zero the storage(delete) after each turn. Here is my code:
contract MyGame {
struct Register {
bool played;
}
mapping (address => Register) players;
Register Reg;
function Play {
players[msg.sender].played=true;
}
function SetUp {
/*this should zero storage before next game*/
delete Reg;
}
}