https://github.com/mlange-42/arche-serde
JSON serialization and deserialization for the Arche Entity Component System (ECS).
https://github.com/mlange-42/arche-serde
ecs entity-component-system go golang json
Last synced: 7 months ago
JSON representation
JSON serialization and deserialization for the Arche Entity Component System (ECS).
- Host: GitHub
- URL: https://github.com/mlange-42/arche-serde
- Owner: mlange-42
- License: mit
- Created: 2024-01-10T17:15:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-22T20:09:03.000Z (10 months ago)
- Last Synced: 2025-02-28T08:55:48.873Z (8 months ago)
- Topics: ecs, entity-component-system, go, golang, json
- Language: Go
- Homepage: https://pkg.go.dev/github.com/mlange-42/arche-serde
- Size: 41 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Arche Serde
[](https://github.com/mlange-42/arche-serde/actions/workflows/tests.yml)
[](https://coveralls.io/github/mlange-42/arche-serde?branch=main)
[](https://goreportcard.com/report/github.com/mlange-42/arche-serde)
[](https://pkg.go.dev/github.com/mlange-42/arche-serde)
[](https://github.com/mlange-42/arche-serde)
[](https://github.com/mlange-42/arche-serde/blob/main/LICENSE)*Arche Serde* provides JSON serialization and deserialization for the [Arche](https://github.com/mlange-42/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](https://pkg.go.dev/github.com/mlange-42/arche-serde) for more details and examples.
[](https://pkg.go.dev/github.com/mlange-42/arche-serde)Serialize a world:
```go
jsonData, err := archeserde.Serialize(&world)
if err != nil {
// handle the error
}
```Deserialize a world:
```go
err = archeserde.Deserialize(jsonData, &world)
if err != nil {
// handle the error
}
```## License
This project is distributed under the [MIT licence](./LICENSE).