| 1154 | } |
| 1155 | |
| 1156 | void LoadHotspotFromXML(EntityDescription& desc, const TiXmlElement* el) { |
| 1157 | desc.AddEntityType(EDF_ENTITY_TYPE, _hotspot_object); |
| 1158 | const char* name = el->Attribute("name"); |
| 1159 | if (name) { |
| 1160 | desc.AddString(EDF_NAME, name); |
| 1161 | } |
| 1162 | std::string type_file = SanitizePath(el->Attribute("type_file")); |
| 1163 | desc.AddString(EDF_FILE_PATH, type_file); |
| 1164 | GetTSRIinfo(desc, el); |
| 1165 | |
| 1166 | std::vector<int> connection_ids; |
| 1167 | const TiXmlElement* connections = el->FirstChildElement("Connections"); |
| 1168 | if (connections) { |
| 1169 | const TiXmlElement* connection = connections->FirstChildElement("Connection"); |
| 1170 | |
| 1171 | int id; |
| 1172 | while (connection) { |
| 1173 | if (connection->QueryIntAttribute("id", &id) == TIXML_SUCCESS) { |
| 1174 | connection_ids.push_back(id); |
| 1175 | } |
| 1176 | connection = connection->NextSiblingElement(); |
| 1177 | } |
| 1178 | } |
| 1179 | desc.AddIntVec(EDF_CONNECTIONS, connection_ids); |
| 1180 | |
| 1181 | connection_ids.resize(0); |
| 1182 | connections = el->FirstChildElement("ConnectionsFrom"); |
| 1183 | if (connections) { |
| 1184 | const TiXmlElement* connection = connections->FirstChildElement("Connection"); |
| 1185 | |
| 1186 | int id; |
| 1187 | while (connection) { |
| 1188 | if (connection->QueryIntAttribute("id", &id) == TIXML_SUCCESS) { |
| 1189 | connection_ids.push_back(id); |
| 1190 | } |
| 1191 | connection = connection->NextSiblingElement(); |
| 1192 | } |
| 1193 | } |
| 1194 | desc.AddIntVec(EDF_CONNECTIONS_FROM, connection_ids); |
| 1195 | } |
| 1196 | |
| 1197 | void LoadEntityDescriptionFromXML(EntityDescription& desc, const TiXmlElement* el) { |
| 1198 | const char* type = el->Value(); |
no test coverage detected