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

Function ReadScriptParametersFromRAM

Source/Scripting/scriptparams.cpp:359–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359void ReadScriptParametersFromRAM(ScriptParamMap &spm, const std::vector<char> &data) {
360 int index = 0;
361 int num_params;
362 memread(&num_params, sizeof(int), 1, data, index);
363 for (int i = 0; i < num_params; ++i) {
364 std::string name;
365 {
366 int str_len;
367 memread(&str_len, sizeof(int), 1, data, index);
368 name.resize(str_len);
369 memread(&name[0], sizeof(char), str_len, data, index);
370 }
371 ScriptParam sp;
372 sp.ReadFromRAM(data, index);
373 spm[name] = sp;
374 }
375}
376
377void WriteScriptParamsToRAM(const ScriptParamMap &spm, std::vector<char> &data) {
378 int num_params = spm.size();

Callers 2

SetFromDescMethod · 0.85
SaveToXMLMethod · 0.85

Calls 3

memreadFunction · 0.85
ReadFromRAMMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected