MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / jsonFromSystemLocation

Function jsonFromSystemLocation

source/game/StarSystemWorld.cpp:77–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77Json 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
88SystemWorldConfig SystemWorldConfig::fromJson(Json const& json) {
89 SystemWorldConfig config;

Callers 5

storeServerDataMethod · 0.85
diskStoreMethod · 0.85
makeQuestCallbacksMethod · 0.85
makePlayerCallbacksMethod · 0.85

Calls 2

hexMethod · 0.80
toJsonMethod · 0.45

Tested by

no test coverage detected