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

Function WriteScriptParamsToRAM

Source/Scripting/scriptparams.cpp:377–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377void WriteScriptParamsToRAM(const ScriptParamMap &spm, std::vector<char> &data) {
378 int num_params = spm.size();
379 memwrite(&num_params, sizeof(int), 1, data);
380 ScriptParamMap::const_iterator iter = spm.begin();
381 for (; iter != spm.end(); ++iter) {
382 {
383 const std::string &str = iter->first;
384 int str_len = str.size();
385 memwrite(&str_len, sizeof(int), 1, data);
386 memwrite(&str[0], sizeof(char), str_len, data);
387 }
388 const ScriptParam &sp = iter->second;
389 sp.WriteToRAM(data);
390 }
391}
392
393const std::string &ScriptParam::GetString() const {
394 if (type_ != STRING && type_ != JSON) {

Callers 1

AddScriptParamsMethod · 0.85

Calls 5

memwriteFunction · 0.85
WriteToRAMMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected