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
Added some comments to the saveload example #492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
examples/saveload.rs
Outdated
@@ -9,6 +9,10 @@ use specs::error::NoError; | |||
use specs::prelude::*; | |||
use specs::saveload::{DeserializeComponents, MarkedBuilder, SerializeComponents, U64Marker, U64MarkerAllocator}; | |||
|
|||
// This is an example of how the serialized data of two entities might look on disk. | |||
// | |||
// When serializing entities, they are written in an array of unnamed structs, each struct representing one entity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnamed structs -> tuples
That's only if you pass a tuple of component storages though. Custom structs are possible, and will be easier with the derive PR.
examples/saveload.rs
Outdated
impl From<ron::ser::Error> for Combined { | ||
fn from(x: ron::ser::Error) -> Self { | ||
Combined::Ron(x) | ||
} | ||
} | ||
|
||
// This returns nothing, in case a `NoError` is received. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be called, thus it cannot return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, rebase needed though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks!
Could you do a rebase (instead of a merge commit) next time, please? Merge commits make the master commit logs hard to read.
bors r+
492: Added some comments to the saveload example r=torkleyy a=Telzhaak I hope they are all correct, please verify. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/slide-rs/specs/492) <!-- Reviewable:end --> Co-authored-by: Telzhaak <da.ahrens@outlook.de>
I tried, but broke everything locally. So I decided to be save and do it here |
Build succeeded |
I hope they are all correct,
please verify.
This change is