private static string GetStringFromChild(NXNode node, string get) { if (!node.ContainsChild(get)) return ""; return node.GetChild(get).ValueOrDie<string>(); }
private static int GetIntFromChild(NXNode node, string get) { if (!node.ContainsChild(get)) return 0; try { return node.GetChild(get).ValueOrDie<int>(); } catch (InvalidCastException) // see Character.wz/Weapon/01482146.img/info/incSTR for more details T_T { return int.Parse(node.GetChild(get).ValueOrDie<string>()); } }
private static Point GetPointFromChild(NXNode node, string get) { if (!node.ContainsChild(get)) return new Point(); return node.GetChild(get).ValueOrDie<Point>(); }
private static float GetFloatFromChild(NXNode node, string get) { if (!node.ContainsChild(get)) return 0; return (float) node.GetChild(get).ValueOrDie<double>(); }