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

Add serialization of OathGames to save strings. #3

Merged
merged 1 commit into from
Jul 4, 2021

Conversation

jenanwise
Copy link
Contributor

This now allows transferring a chronicle from the real world to TTS: manually construct an OathGame object and then use serializOathGame to get a string that can be loaded into TTS.

For every TTS save string, we can now parse the string into an OathGame object and then serialize back to the original string. inverseParse.js was added as a mini test suit to verify this property against known strings.

Some small bugs in the parser were fixed in the process:

  • Suit order was being parsed incorrectly.
  • Previous game winner was always Brown and did not support Purple in enum.
  • Previous game winner and exile status were looking at the wrong offsets.

This now allows transferring a chronicle from the real world to TTS:
manually construct an `OathGame` object and then use `serializOathGame`
to get a string that can be loaded into TTS.

For every TTS save string, we can now parse the string into an
`OathGame` object and then serialize back to the original string.
`inverseParse.js` was added as a mini test suit to verify this
property against known strings.

Some small bugs in the parser were fixed in the process:

- Suit order was being parsed incorrectly.
- Previous game winner was always Brown and did not support Purple in enum.
- Previous game winner and exile status were looking at the wrong
offsets.
@seiyria seiyria merged commit 70bb1f7 into Vagabottos:master Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants