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

Saveload example that features serializing/deserializing a whole World #497

Closed
expenses opened this issue Oct 20, 2018 · 9 comments
Closed
Labels
docs feature-request stale No activity since 60, issue is about to be closed

Comments

@expenses
Copy link
Contributor

Now that #460 has been merged, do you think we can get a more updated saveload example? I havent had much of a look at the existing docs, but it seems a little confusing. How would I go about e.g. serializing a whole World?

@expenses
Copy link
Contributor Author

Actually, the docs for the specs::saveload::ConvertSaveload for the git version are pretty decent, what I'm really after is an easy example for serializing everything contained in a World.

@expenses expenses changed the title A new saveload example that features deriving saveload Saveload example that features serializing/deserializing a whole World Oct 21, 2018
@torkleyy
Copy link
Member

You cannot just serialize the whole world, you would have to specify the components individually.

@expenses
Copy link
Contributor Author

Oh ok, would there be a way to implement that? It would be incredibly helpful.

@torkleyy
Copy link
Member

This is basically blocked by Rust, we need specialization for implementing that feature.

@torkleyy
Copy link
Member

There is AnyStorage which we have a collection of, but not every component is serializable. If there was specialization, it could provide a method that serializes the components if possible.

By specifying all the types we can statically retrieve the implementation for Serialize / Deserialize.

@expenses
Copy link
Contributor Author

Got it, thanks. I'll try my hand at serializing the individual components, I just have quite a few of them haha

@Riey
Copy link

Riey commented Feb 11, 2019

@torkleyy

I want to saveload World either

specialization feature is not stable yet but it's possible to apply to Serialize and Deserialize

I make crate for that https://crates.io/crates/maybe-serde

it can be help for solve this issue?

@torkleyy
Copy link
Member

Interesting! I think it could be used for this, yes.

@stale
Copy link

stale bot commented Apr 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant.

@stale stale bot added the stale No activity since 60, issue is about to be closed label Apr 13, 2019
@stale stale bot closed this as completed Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs feature-request stale No activity since 60, issue is about to be closed
Projects
None yet
Development

No branches or pull requests

3 participants