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

Loose deserialization type matching #302

Open
ekolis opened this issue Feb 10, 2024 · 1 comment
Open

Loose deserialization type matching #302

ekolis opened this issue Feb 10, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@ekolis
Copy link
Owner

ekolis commented Feb 10, 2024

What do you want to see?
If a type can't be found when deserializing, look for types with the same name in a different namespace.

How would it help players?
Don't crash when loading old games after types are moved around (e.g. savegames linked to bugs such as #295 after working on #300 or #152)

Alternatives
Type aliases for serialization - this would also save space in savegames not writing down long namespace names, but I'm not sure if it would be possible to do without modifying all the types or if static interface methods can access the concrete type name to get a default serialization alias if none is provided.

Screenshots and mockups
N/A

Things to consider
A cache dictionary for mapping serialized type names to actual types would cut down on repeated reflection calls.

@ekolis ekolis added the enhancement New feature or request label Feb 10, 2024
@ekolis ekolis added this to the alpha-10 milestone Feb 10, 2024
@ekolis
Copy link
Owner Author

ekolis commented Jun 1, 2024

Another alternative is #312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

1 participant