Exemple #1
0
        public override float Evaluate(EvalContext context)
        {
            int   generatedValue = random.Next(10000);
            float value          = ((float)generatedValue) * 0.0001f;

            return(value);
        }
Exemple #2
0
        public sealed override T Evaluate(EvalContext context)
        {
            if (Condition != null && Cases != null)
            {
                float conditionValue = Condition.Evaluate(context);

                foreach (var item in Cases)
                {
                    if (item.Min <= conditionValue && conditionValue <= item.Max)
                    {
                        if (item.Item != null)
                        {
                            return(item.Item.Evaluate(context));
                        }
                        else
                        {
                            return(default(T));
                        }
                    }
                }

                if (DefaultCase != null)
                {
                    DefaultCase.Evaluate(context);
                }
            }

            return(default(T));
        }
Exemple #3
0
        public sealed override T Evaluate(EvalContext context)
        {
            if (timeChanged)
            {
                timeChanged = false;
                UpdateValue();
            }

            return(Value);
        }
 public sealed override T Evaluate(EvalContext context)
 {
     if (Left != null && Right != null)
     {
         return(Calculate(Left.Evaluate(context), Right.Evaluate(context)));
     }
     else
     {
         return(default(T));
     }
 }
 public sealed override T Evaluate(EvalContext context)
 {
     if (Operand != null)
     {
         return(Calculate(Operand.Evaluate(context)));
     }
     else
     {
         return(default(T));
     }
 }
 public sealed override T Evaluate(EvalContext context)
 {
     if (Value1 != null && Value2 != null && Weight != null)
     {
         return(Interpolate(Value1.Evaluate(context),
                            Value2.Evaluate(context),
                            easingCurve.Ease(Weight.Evaluate(context))));
     }
     else
     {
         return(default(T));
     }
 }
Exemple #7
0
        public sealed override T Evaluate(EvalContext context)
        {
            if (UpdateMode == EvalCacheUpdateMode.UpdateAtEverytime)
            {
                valueChanged = true;
            }

            if (valueChanged)
            {
                valueChanged = false;
                if (Source != null)
                {
                    value = Source.Evaluate(context);
                }
                else
                {
                    value = default(T);
                }
            }

            return(value);
        }
Exemple #8
0
 public sealed override T Evaluate(EvalContext context)
 {
     return(default(T));
 }
Exemple #9
0
 public abstract T Evaluate(EvalContext context);
Exemple #10
0
 public override float Evaluate(EvalContext context)
 {
     return(evaluatedTime);
 }
Exemple #11
0
 public sealed override T Evaluate(EvalContext context)
 {
     return(Value);
 }