Skip to content

mlange-42/arche-serde

Repository files navigation

Arche Serde

Test status Coverage Status Go Report Card Go Reference GitHub MIT license

Arche Serde provides JSON serialization and deserialization for the Arche Entity Component System (ECS).

Features

  • Serialize/deserialize an entire Arche world in one line.
  • Proper serialization of entity relations, as well as of entities stored in components.
  • Skip arbitrary components and resources when serializing or deserializing.

Installation

go get github.com/mlange-42/arche-serde

Usage

See the API docs for more details and examples.
Go Reference

Serialize a world:

jsonData, err := archeserde.Serialize(&world)
if err != nil {
    // handle the error
}

Deserialize a world:

err = archeserde.Deserialize(jsonData, &world)
if err != nil {
    // handle the error
}

License

This project is distributed under the MIT licence.