Beispiel #1
0
        public void OperationValue(ValueFunctor func, float val)
        {
            if (ValueType != VarType.FLOAT)
            {
                return;
            }

            float realVal = IntValue;

            switch (func)
            {
            case ValueFunctor.Set:
                realVal = val;
                break;

            case ValueFunctor.Add:
                realVal += val;
                break;

            case ValueFunctor.Reduce:
                realVal -= val;
                break;

            case ValueFunctor.Multiply:
                realVal *= val;
                break;

            case ValueFunctor.Divide:
                realVal /= val;
                break;
            }
            _value = realVal;
        }
Beispiel #2
0
 public void OperationValue(ValueFunctor func, bool val)
 {
     if (func == ValueFunctor.Set)
     {
         _value = val;
     }
 }
Beispiel #3
0
        public void OperationValue(ValueFunctor func, string val)
        {
            switch (ValueType)
            {
            case VarType.INT:
                OperationValue(func, Convert.ToInt32(val));
                break;

            case VarType.FLOAT:
                OperationValue(func, Convert.ToSingle(val));
                break;

            case VarType.BOOL:
                OperationValue(func, Convert.ToBoolean(val));
                break;

            case VarType.STRING:
                if (func == ValueFunctor.Set)
                {
                    _value = val;
                }
                break;
            }
        }
Beispiel #4
0
        public void OperationValue(ValueFunctor func, float val)
        {
            if (ValueType != VarType.FLOAT) return;

            float realVal = IntValue;
            switch (func)
            {
                case ValueFunctor.Set:
                    realVal = val;
                    break;
                case ValueFunctor.Add:
                    realVal += val;
                    break;
                case ValueFunctor.Reduce:
                    realVal -= val;
                    break;
                case ValueFunctor.Multiply:
                    realVal *= val;
                    break;
                case ValueFunctor.Divide:
                    realVal /= val;
                    break;
            }
            _value = realVal;
        }
Beispiel #5
0
 public void OperationValue(ValueFunctor func, bool val)
 {
     if (func == ValueFunctor.Set) _value = val;
 }
Beispiel #6
0
 public void OperationValue(ValueFunctor func, string val)
 {
     switch (ValueType)
     {
         case VarType.INT:
             OperationValue(func, Convert.ToInt32(val));
             break;
         case VarType.FLOAT:
             OperationValue(func, Convert.ToSingle(val));
             break;
         case VarType.BOOL:
             OperationValue(func, Convert.ToBoolean(val));
             break;
         case VarType.STRING:
             if (func == ValueFunctor.Set) _value = val;
             break;
     }
 }