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

Function jsonToPhysicsForceRegion

source/game/StarForceRegions.cpp:187–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187PhysicsForceRegion jsonToPhysicsForceRegion(Json const& json) {
188 String type = json.getString("type");
189 if (type.equalsIgnoreCase("DirectionalForceRegion"))
190 return DirectionalForceRegion::fromJson(json);
191 else if (type.equalsIgnoreCase("RadialForceRegion"))
192 return RadialForceRegion::fromJson(json);
193 else if (type.equalsIgnoreCase("GradientForceRegion"))
194 return GradientForceRegion::fromJson(json);
195 else
196 throw JsonException::format("No such physics force region type '{}'", type);
197}
198
199}

Callers 3

VehicleMethod · 0.85
setupMethod · 0.85
PhysicsObjectMethod · 0.85

Calls 3

getStringMethod · 0.80
formatFunction · 0.50
equalsIgnoreCaseMethod · 0.45

Tested by

no test coverage detected