CSLE.CLS_Type_Enum.Math2Value C# (CSharp) Method

Math2Value() public method

public Math2Value ( CLS_Content content, char code, object left, CLS_Content right, CLType &returnType ) : object
content CLS_Content
code char
left object
right CLS_Content
returnType CLType
return object
        public object Math2Value(CLS_Content content, char code, object left, CLS_Content.Value right, out CLType returnType)
        {
            returnType = type;

            int tLeft = System.Convert.ToInt32(left);
            int tRight = System.Convert.ToInt32(right.value);

            switch (code)
            {
                case '+':
                    return tLeft + tRight;
                case '-':
                    return tLeft - tRight;
                case '*':
                    return tLeft * tRight;
                case '/':
                    return tLeft / tRight;
                case '%':
                    return tLeft % tRight;
                case '<':
                    return tLeft << tRight;
                case '>':
                    return tLeft >> tRight;
                case '&':
                    return tLeft & tRight;
                case '|':
                    return tLeft | tRight;
                case '~':
                    return ~tLeft;
                case '^':
                    return tLeft ^ tRight;
            }

            throw new NotImplementedException();
        }