static void AddToUpdate(ushort nodeId) { if (NodesMarkup.ContainsKey(nodeId)) { NeedUpdate.Add(nodeId); } }
public static Markup Get(ushort nodeId) { if (!NodesMarkup.TryGetValue(nodeId, out Markup markup)) { markup = new Markup(nodeId); NodesMarkup[nodeId] = markup; } return(markup); }
public static void NetManagerSimulationStepImplPostfix() { var needUpdate = NeedUpdate.ToArray(); NeedUpdate.Clear(); foreach (var nodeId in needUpdate) { if (NodesMarkup.TryGetValue(nodeId, out Markup markup)) { markup.Update(); } } }
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 void NetManagerReleaseNodeImplementationPrefix(ushort node) => NodesMarkup.Remove(node);
public static bool TryGetMarkup(ushort nodeId, out Markup markup) => NodesMarkup.TryGetValue(nodeId, out markup);
public static void DeleteAll() { Logger.LogDebug($"{nameof(MarkupManager)}.{nameof(DeleteAll)}"); NodesMarkup.Clear(); }
public static void Clear() { Logger.LogDebug($"{nameof(MarkupManager)}.{nameof(Clear)}"); NeedUpdate.Clear(); NodesMarkup.Clear(); }