MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetJSONVal

Method GetJSONVal

Source/Scripting/scriptparams.cpp:95–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95SimpleJSONWrapper ScriptParams::GetJSONVal(const std::string &val) {
96 ScriptParamMap::iterator iter = parameter_map_.find(val);
97 if (iter != parameter_map_.end() && iter->second.IsJSON()) {
98 return iter->second.GetJSON();
99 } else {
100 DisplayError("Error", ("No parameter \"" + val + "\" of correct type.").c_str());
101 SimpleJSONWrapper nullWrapper;
102 return nullWrapper;
103 }
104}
105
106bool ScriptParams::HasParam(const std::string &val) const {
107 return parameter_map_.find(val) != parameter_map_.end();

Callers

nothing calls this directly

Calls 6

IsJSONMethod · 0.80
GetJSONMethod · 0.80
DisplayErrorFunction · 0.50
findMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected