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); }
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))); }
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); }
public bool Equals(SlateRef <T> other) { return(this == other); }