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

Method SaveToXML

Source/Objects/object.cpp:176–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void Object::SaveToXML(TiXmlElement *parent) {
177 // Don't save if object has "No Save" parameter with value 1
178 bool no_save = false;
179 const ScriptParamMap &script_param_map = sp.GetParameterMap();
180 const ScriptParamMap::const_iterator it = script_param_map.find("No Save");
181 if (it != script_param_map.end()) {
182 const ScriptParam &param = it->second;
183 if (param.GetInt() == 1) {
184 no_save = true;
185 }
186 }
187 if (!no_save) {
188 EntityDescription desc;
189 GetDesc(desc);
190 desc.SaveToXML(parent);
191 }
192}
193
194bool Object::SetFromDesc(const EntityDescription &desc) {
195 for (const auto &field : desc.fields) {

Callers 3

SaveEntitiesMethod · 0.45
SavePrefabMethod · 0.45
SaveSelectedMethod · 0.45

Calls 3

findMethod · 0.45
endMethod · 0.45
GetIntMethod · 0.45

Tested by

no test coverage detected