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

Method parametricTableFromConfig

source/game/StarStoredFunctions.cpp:234–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234ParametricTable<int, Json> FunctionDatabase::parametricTableFromConfig(Json descriptor) {
235 try {
236 List<pair<int, Json>> points;
237 for (size_t i = 0; i < descriptor.size(); ++i) {
238 auto pointPair = descriptor.get(i);
239 if (pointPair.size() != 2)
240 throw StoredFunctionException("Each point must be a list of size 2");
241 points.append({pointPair.getInt(0), pointPair.get(1)});
242 }
243
244 return ParametricTable<int, Json>(points);
245 } catch (StarException const& e) {
246 throw StoredFunctionException("Error parsing StoredConfigFunction descriptor", e);
247 }
248}
249
250MultiTable2D FunctionDatabase::multiTable2DFromConfig(Json descriptor) {
251 try {

Callers

nothing calls this directly

Calls 4

getIntMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected