Data.EventsData.ParseCommonAFK C# (CSharp) Method

ParseCommonAFK() private method

private ParseCommonAFK ( Dictionary events, System.Xml.Linq.XDocument xml ) : void
events Dictionary
xml System.Xml.Linq.XDocument
return void
        private void ParseCommonAFK(Dictionary<Event, List<Actions.Action>> events, XDocument xml)
        {
            var root = xml.Root;
            var default_active = root.Attribute("active")?.Value ?? "True";
            var commonAfk = root.Element("common_afk");
            if (commonAfk == null) { return; }

            var active = bool.Parse(commonAfk.Attribute("active")?.Value ?? default_active);
            var ev = new CommonAFKEvent(active);
            events.Add(ev, new List<Actions.Action>());
            ParseActions(commonAfk, events, ev);
        }