Created
June 11, 2016 20:16
-
-
Save boustrophedon/11bb8d76702e3e6ed4b33c4ba8ad8273 to your computer and use it in GitHub Desktop.
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
struct Entity { | |
pub id: usize, | |
pub ver: usize, | |
} | |
impl Eq for Entity { | |
fn eq(self, other: Entity) { | |
return (self.id == other.id) && (self.ver == other.ver); | |
} | |
} | |
// the point of ver is that if we reuse an id, and a new one is allocated on the server | |
// with the same id as an old one that still is being used on the local world | |
// then the ver of the one on the server will be different because we keep track of the versions in a hashmap | |
// on the server, i guess? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment