| 51 | } |
| 52 | |
| 53 | Vector3 GetVector3FromXml(const xml_node& parent, const PUGIXML_CHAR* name, const Vector3& defaultValue) |
| 54 | { |
| 55 | const auto node = parent.child(name); |
| 56 | if (!node.empty()) |
| 57 | { |
| 58 | const auto x = node.child_value(PUGIXML_TEXT("X")); |
| 59 | const auto y = node.child_value(PUGIXML_TEXT("Y")); |
| 60 | const auto z = node.child_value(PUGIXML_TEXT("Z")); |
| 61 | if (x && y && z) |
| 62 | { |
| 63 | XmlCharAsChar xs(x), ys(y), zs(z); |
| 64 | Float3 v; |
| 65 | if (!StringUtils::Parse(xs.Str, &v.X) && !StringUtils::Parse(ys.Str, &v.Y) && !StringUtils::Parse(zs.Str, &v.Z)) |
| 66 | { |
| 67 | return (Vector3)v; |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | return defaultValue; |
| 72 | } |
| 73 | |
| 74 | int32 GetIntFromXml(const xml_node& parent, const PUGIXML_CHAR* name, const int32 defaultValue) |
| 75 | { |
no test coverage detected