Load() private method

private Load ( System.Xml.Linq.XElement effectNode ) : EffectInfo
effectNode System.Xml.Linq.XElement
return EffectInfo
Ejemplo n.º 1
0
        public TriggerInfo Load(XElement triggerNode)
        {
            string conditionString;

            if (triggerNode.Attribute("condition") != null)
            {
                conditionString = triggerNode.GetAttribute <string>("condition");
            }
            else
            {
                conditionString = triggerNode.Element("Condition").Value;
            }

            var effectNode = triggerNode.Element("Effect");
            var effect     = _effectReader.Load(effectNode);

            var elseNode   = triggerNode.Element("Else");
            var elseEffect = (elseNode != null) ? _effectReader.Load(elseNode) : null;

            var priority = triggerNode.TryAttribute <int?>("priority");

            return(new TriggerInfo()
            {
                Condition = conditionString,
                Effect = effect,
                Else = elseEffect,
                Priority = priority
            });
        }
 public IEffectPartInfo Load(XElement partNode)
 {
     return(new DelayedEffectPartInfo()
     {
         DelayFrames = partNode.GetAttribute <int>("frames"),
         Effect = _effectReader.Load(partNode)
     });
 }