Exemple #1
0
        public IEnumerable <IEntity> Filter(IEnumerable <IEntity> entities, DynamicValueContext context)
        {
            ValueFilter filter = m_valueFilter;

            foreach (IEntity entity in entities)
            {
                IEntityWithAction entityWithAction = entity as IEntityWithAction;
                if (entityWithAction != null)
                {
                    if (filter == null)
                    {
                        if (!entityWithAction.hasRange)
                        {
                            yield return(entity);
                        }
                    }
                    else if (entityWithAction.hasRange && filter.Matches(entityWithAction.rangeMax, context))
                    {
                        yield return(entity);
                    }
                }
            }
        }
Exemple #2
0
 public void PopulateFromJson(JObject jsonObject)
 {
     m_valueFilter = ValueFilter.FromJsonProperty(jsonObject, "valueFilter");
 }
        public static ValueFilter FromJsonProperty(JObject jsonObject, string propertyName, ValueFilter defaultValue = null)
        {
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Invalid comparison between Unknown and I4
            JProperty val = jsonObject.Property(propertyName);

            if (val == null || (int)val.get_Value().get_Type() == 10)
            {
                return(defaultValue);
            }
            return(FromJsonToken(val.get_Value()));
        }
Exemple #4
0
 public void PopulateFromJson(JObject jsonObject)
 {
     m_targetsToCompare = ITargetSelectorUtils.FromJsonProperty(jsonObject, "targetsToCompare");
     m_distance         = ValueFilter.FromJsonProperty(jsonObject, "distance");
 }
Exemple #5
0
 public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_value     = DynamicValue.FromJsonProperty(jsonObject, "value");
     m_evaluator = ValueFilter.FromJsonProperty(jsonObject, "evaluator");
 }
 public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_selector = FilteredEntitySelector.FromJsonProperty(jsonObject, "selector");
     m_value    = ValueFilter.FromJsonProperty(jsonObject, "value");
 }