localcc / gvas

GVAS file format parsing library for rust
MIT License
19 stars 2 forks source link

Add serde support #2

Closed FeldrinH closed 1 year ago

FeldrinH commented 1 year ago

This pull request adds serde support behind a "serde" feature.

This is allows you to convert the parsed gvas data to and from many common formats such as JSON. This can be useful to process the data in other programming languages or general purpose JSON processing tools (for example generate TypeScript types from JSON to help determine the structure of the data).

For the most part this involves just adding #derive(Serialize, Deserialize) to relevant structs, however, there are some places where custom logic was added:

FeldrinH commented 1 year ago

Here is an example of a gvas save file (my DRG save) and the corresponding JSON produced by serde: gvas_json_example.zip