Exemple #1
0
        public static FmlArg Arg(BaseValueType t, float v)
        {
            FmlArg arg = new FmlArg(t);

            arg.SetSingle(v);
            return(arg);
        }
Exemple #2
0
        public static FmlArg Arg(BaseValueType t, long v)
        {
            FmlArg arg = new FmlArg(t);

            arg.SetInt64(v);
            return(arg);
        }
Exemple #3
0
        public static FmlArg Arg(BaseValueType t, double v)
        {
            FmlArg arg = new FmlArg(t);

            arg.SetDouble(v);
            return(arg);
        }
Exemple #4
0
        public static FmlArg Arg(BaseValueType t, int v)
        {
            FmlArg arg = new FmlArg(t);

            arg.SetInt32(v);
            return(arg);
        }
Exemple #5
0
        public UnionValue(BaseValueType type, double v)
        {
            Int32  = 0;
            Int64  = 0;
            Single = 0f;
            Double = 0.0;
            switch (type)
            {
            case BaseValueType.Double:
                Double = (double)v;
                break;

            case BaseValueType.Single:
                Single = (float)v;
                break;

            case BaseValueType.Int64:
                Int64 = (long)v;
                break;

            case BaseValueType.Int32:
            default:
                Int32 = (int)v;
                break;
            }
        }
Exemple #6
0
 public FmlRound(BaseValueType t, FmlNode v, int digit = 0, MidpointRounding mode = MidpointRounding.AwayFromZero)
     : base(t, 1)
 {
     Value = v;
     Digit = digit;
     Mode  = mode;
 }
Exemple #7
0
        public static FmlMin Min(BaseValueType t, params FmlNode[] args)
        {
            FmlMin op = new FmlMin(t);

            AddChildrenToVariableBranch(op, args);
            return(op);
        }
Exemple #8
0
 // difference = minuend - subtrahend
 public FmlRand(BaseValueType t, int seed, FmlNode minValue, FmlNode maxValue, bool manualRand = false)
     : base(t, 2)
 {
     _rand      = new Random(seed);
     Seed       = seed;
     MinValue   = minValue;
     MaxValue   = maxValue;
     ManualRand = manualRand;
 }
Exemple #9
0
 // arity 必須大於 0
 protected FmlArityOp(BaseValueType t, int arity)
     : base(t, arity)
 {
     // initial _childList
     for (int i = 0, imax = arity; i < imax; ++i)
     {
         ChildList.Add(null);
     }
     ChildCount = arity;
 }
Exemple #10
0
        public float GetSingle(BaseValueType type)
        {
            switch (type)
            {
            case BaseValueType.Double:
                return((float)Double);

            case BaseValueType.Single:
                return((float)Single);

            case BaseValueType.Int64:
                return((float)Int64);

            case BaseValueType.Int32:
            default:
                return((float)Int32);
            }
        }
Exemple #11
0
        public int GetInt32(BaseValueType type)
        {
            switch (type)
            {
            case BaseValueType.Double:
                return((int)Double);

            case BaseValueType.Single:
                return((int)Single);

            case BaseValueType.Int64:
                return((int)Int64);

            case BaseValueType.Int32:
            default:
                return((int)Int32);
            }
        }
Exemple #12
0
        public long GetInt64(BaseValueType type)
        {
            switch (type)
            {
            case BaseValueType.Double:
                return((long)Double);

            case BaseValueType.Single:
                return((long)Single);

            case BaseValueType.Int64:
                return((long)Int64);

            case BaseValueType.Int32:
            default:
                return((long)Int32);
            }
        }
Exemple #13
0
        public double GetDouble(BaseValueType type)
        {
            switch (type)
            {
            case BaseValueType.Double:
                return((double)Double);

            case BaseValueType.Single:
                return((double)Single);

            case BaseValueType.Int64:
                return((double)Int64);

            case BaseValueType.Int32:
            default:
                return((double)Int32);
            }
        }
Exemple #14
0
 public FmlPow(BaseValueType t) : this(t, null, null)
 {
 }
Exemple #15
0
 public FmlFloor(BaseValueType t, FmlNode v)
     : base(t, 1)
 {
     Value = v;
 }
Exemple #16
0
 public FmlFloor(BaseValueType t) : this(t, null)
 {
 }
Exemple #17
0
 // quotient = dividend - divisor
 public FmlDiv(BaseValueType t, FmlNode dividend, FmlNode divisor)
     : base(t, 2)
 {
     Dividend = dividend;
     Divisor  = divisor;
 }
Exemple #18
0
 public FmlDiv(BaseValueType t) : this(t, null, null)
 {
 }
 protected FmlVariableOp(BaseValueType t)
     : base(t, 20)
 {
 }
Exemple #20
0
 public FmlMod(BaseValueType t) : this(t, null, null)
 {
 }
Exemple #21
0
 public FmlSqrt(BaseValueType t) : this(t, null)
 {
 }
Exemple #22
0
 public FmlLog10(BaseValueType t) : this(t, null)
 {
 }
Exemple #23
0
 public FmlAbs(BaseValueType t, FmlNode v)
     : base(t, 1)
 {
     Value = v;
 }
Exemple #24
0
 public FmlAbs(BaseValueType t) : this(t, null)
 {
 }
Exemple #25
0
 // difference = minuend - subtrahend
 public FmlSub(BaseValueType t, FmlNode minuend, FmlNode subtrahend)
     : base(t, 2)
 {
     Minuend    = minuend;
     Subtrahend = subtrahend;
 }
Exemple #26
0
 public FmlSub(BaseValueType t) : this(t, null, null)
 {
 }
Exemple #27
0
 public FmlAdd(BaseValueType t) : base(t)
 {
 }
Exemple #28
0
 // difference = minuend - subtrahend
 public FmlPow(BaseValueType t, FmlNode x, FmlNode y)
     : base(t, 2)
 {
     X = x;
     Y = y;
 }
Exemple #29
0
 public FmlLog10(BaseValueType t, FmlNode v)
     : base(t, 1)
 {
     Value = v;
 }
Exemple #30
0
 protected FmlOp(BaseValueType t, int childListCap)
     : base(t)
 {
     ChildList  = new List <FmlNode>(childListCap);
     ChildCount = 0;
 }