jkomoros / boardgame

An in-progress framework in golang to easily build boardgame Progressive Web Apps
Apache License 2.0
31 stars 4 forks source link

filesystem/record should support multiple encodings of states #699

Closed jkomoros closed 6 years ago

jkomoros commented 6 years ago

Detected while fixing #648.

gojsondiff has an error of diffing in certain cases.

But just switchign to josephburnett/jd doesn't feel right because a) it might also have encoding bugs, and b) there's also a legitimate need to just have full raw encoding of full states.

Make it so that records can detect their encoding of states and can save them according to it

jkomoros commented 6 years ago
jkomoros commented 6 years ago

In the end, this ended up being a full encoding (fallback) and a diff encoding (default, as long as the underlying diff library doesn't have a problem in that instance)