コード例 #1
0
        public static LookTargets ToLookTargets(SlateRef <IEnumerable <object> > objects, Slate slate)
        {
            if (objects.GetValue(slate) == null || !objects.GetValue(slate).Any())
            {
                return(LookTargets.Invalid);
            }
            LookTargets lookTargets = new LookTargets();

            foreach (object item in objects.GetValue(slate))
            {
                if (item is Thing)
                {
                    lookTargets.targets.Add((Thing)item);
                }
                else if (item is WorldObject)
                {
                    lookTargets.targets.Add((WorldObject)item);
                }
                else if (item is Map)
                {
                    lookTargets.targets.Add(((Map)item).Parent);
                }
            }
            return(lookTargets);
        }
コード例 #2
0
 public static LookTargets ToLookTargets(SlateRef <IEnumerable <object> > objects, Slate slate)
 {
     if (objects.GetValue(slate) == null || !objects.GetValue(slate).Any())
     {
         return(LookTargets.Invalid);
     }
     return(ToLookTargets(objects.GetValue(slate)));
 }
コード例 #3
0
 public void LoadDataFromXmlCustom(XmlNode xmlRoot)
 {
     if (xmlRoot.ChildNodes.Count != 1)
     {
         Log.Error("Misconfigured PrefixCapturedVar: " + xmlRoot.OuterXml);
         return;
     }
     name  = xmlRoot.Name;
     value = new SlateRef <object>(DirectXmlToObject.InnerTextWithReplacedNewlinesOrXML(xmlRoot));
     TKeySystem.MarkTreatAsList(xmlRoot.ParentNode);
 }
コード例 #4
0
 public bool Equals(SlateRef <T> other)
 {
     return(this == other);
 }