Beispiel #1
0
        public MathValue(object objectValue) : this()
        {
            if (objectValue == null)
            {
                ValueClass = ValueClassifier.None;
            }
            else
            {
                var objectType = objectValue.GetType();

                if (objectType == typeof(int))
                {
                    ValueClass = ValueClassifier.Int;
                    IntValue   = (int)objectValue;
                }
                else if (objectType == typeof(float))
                {
                    ValueClass = ValueClassifier.Float;
                    FloatValue = (float)objectValue;
                }
                else if (objectType == typeof(bool))
                {
                    ValueClass = ValueClassifier.Boolean;
                    BoolValue  = (bool)objectValue;
                }
            }
        }
Beispiel #2
0
 public MathValue(int intValue) : this()
 {
     IntValue   = intValue;
     ValueClass = ValueClassifier.Int;
 }
Beispiel #3
0
 public MathValue(float floatValue, bool isFractional) : this()
 {
     FloatValue = floatValue;
     ValueClass = isFractional ? ValueClassifier.FloatFractional : ValueClassifier.Float;
 }
Beispiel #4
0
 public MathValue(bool boolValue) : this()
 {
     BoolValue  = boolValue;
     ValueClass = ValueClassifier.Boolean;
 }