Data.EventsData.ParseCooldown C# (CSharp) Method

ParseCooldown() private method

private ParseCooldown ( Dictionary events, System.Xml.Linq.XDocument xml ) : void
events Dictionary
xml System.Xml.Linq.XDocument
return void
        private void ParseCooldown(Dictionary<Event, List<Actions.Action>> events, XDocument xml)
        {
            var root = xml.Root;
            var default_active = root.Attribute("active")?.Value ?? "True";
            var default_priority = root.Attribute("priority")?.Value ?? "5";
            var default_blacklist = ParseAreaBossBlackList(root);
            foreach (var abnormality in root.Elements("cooldown"))
            {
                var skillId = int.Parse(abnormality.Attribute("skill_id").Value);
                var onlyResetted = bool.Parse(abnormality.Attribute("only_resetted")?.Value??"True");
                var active = bool.Parse(abnormality.Attribute("active")?.Value ?? default_active);
                var ingame = bool.Parse(abnormality.Attribute("ingame").Value);
                var priority = int.Parse(abnormality.Attribute("priority")?.Value ?? default_priority);
                var blacklist = ParseAreaBossBlackList(abnormality);
                var cooldownEvent = new CooldownEvent(ingame, active, priority, blacklist.Any()?blacklist:default_blacklist, skillId, onlyResetted);
                events.Add(cooldownEvent, new List<Actions.Action>());
                ParseActions(abnormality, events, cooldownEvent);
            }
        }