| 75 | } |
| 76 | |
| 77 | Json jsonFromSystemLocation(SystemLocation const& location) { |
| 78 | if (auto coordinate = location.maybe<CelestialCoordinate>()) |
| 79 | return JsonArray{"coordinate", coordinate->toJson()}; |
| 80 | else if (auto orbit = location.maybe<CelestialOrbit>()) |
| 81 | return JsonArray{"orbit", orbit->toJson()}; |
| 82 | else if(auto uuid = location.maybe<Uuid>()) |
| 83 | return JsonArray{"object", uuid->hex()}; |
| 84 | else |
| 85 | return jsonFromMaybe<Vec2F>(location.maybe<Vec2F>(), jsonFromVec2F); |
| 86 | } |
| 87 | |
| 88 | SystemWorldConfig SystemWorldConfig::fromJson(Json const& json) { |
| 89 | SystemWorldConfig config; |
no test coverage detected