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

Method buildConfig

source/game/StarNpcDatabase.cpp:368–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366}
367
368Json NpcDatabase::buildConfig(String const& typeName, Json const& overrides) const {
369 auto const& baseConfig = m_npcTypes.get(typeName);
370 auto config = mergeConfigValues(baseConfig, overrides);
371
372 String baseTypeName = baseConfig.getString("baseType", "");
373 if (baseTypeName.empty()) {
374 return config;
375 } else {
376 return buildConfig(baseTypeName, config);
377 }
378}
379
380Json NpcDatabase::mergeConfigValues(Json const& base, Json const& merger) const {
381 if (base.type() == Json::Type::Object && merger.type() == Json::Type::Object) {

Callers 1

npcConfigMethod · 0.80

Calls 3

getStringMethod · 0.80
getMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected