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

Function jsonToVec2D

source/core/StarJsonExtra.cpp:23–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23Vec2D jsonToVec2D(Json const& v) {
24 if (v.type() != Json::Type::Array || v.size() != 2)
25 throw JsonException("Json not an array of size 2 in jsonToVec2D");
26
27 return Vec2D(v.getDouble(0), v.getDouble(1));
28}
29
30Vec2F jsonToVec2F(Json const& v) {
31 if (v.type() != Json::Type::Array || v.size() != 2)

Callers 2

jsonToRectDFunction · 0.85
jsonToPolyDFunction · 0.85

Calls 3

getDoubleMethod · 0.80
typeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected