| 174 | } |
| 175 | |
| 176 | void 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 ¶m = 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 | |
| 194 | bool Object::SetFromDesc(const EntityDescription &desc) { |
| 195 | for (const auto &field : desc.fields) { |
no test coverage detected