public static bool FromXml(string version, XElement config, out Markup markup) { var nodeId = config.GetAttrValue <ushort>(nameof(Id)); markup = MarkupManager.Get(nodeId); markup.FromXml(version, config); return(true); }
public static void FromXml(XElement config) { NodesMarkup.Clear(); var version = config.GetAttrValue("V", Mod.Version); foreach (var markupConfig in config.Elements(Markup.XmlName)) { if (Markup.FromXml(version, markupConfig, out Markup markup)) { NeedUpdate.Add(markup.Id); } } }
public static bool FromXml(Version version, XElement config, out Markup markup) { var nodeId = config.GetAttrValue <ushort>(nameof(Id)); try { markup = MarkupManager.Get(nodeId); markup.FromXml(version, config); return(true); } catch (Exception error) { Logger.LogError(() => $"Could load node #{nodeId} markup", error); markup = null; MarkupManager.LoadErrors += 1; return(false); } }
public static void FromXml(XElement config, ObjectsMap map, bool clear = true) { if (clear) { Clear(); } LoadErrors = 0; var version = config.GetAttrValue("V", Mod.Version); foreach (var markupConfig in config.Elements(Markup.XmlName)) { if (Markup.FromXml(version, markupConfig, map, out Markup markup)) { NeedUpdate.Add(markup.Id); } } }