Exemplo n.º 1
0
    public static string[] GetMathOperationString()
    {
        if (MathOperationString == null)
        {
            MathOperationString = new string[(int)(E_MathOperation.GreaterThan) + 1];
            for (int i = 0; i < ((int)E_MathOperation.GreaterThan) + 1; i++)
            {
                E_MathOperation math = (E_MathOperation)(i);
                MathOperationString[i] = string.Format("{0} {1}", OperationString(math), math);
            }
        }

        return(MathOperationString);
    }
Exemplo n.º 2
0
    public static bool OperationCheck(E_MathOperation eOperation, float a, float b)
    {
        switch (eOperation)
        {
        case E_MathOperation.LessThan:
            return(a < b ? true : false);

        case E_MathOperation.LessThanOrEqualTo:
            return(a <= b ? true : false);

        case E_MathOperation.EqualTo:
            return(a == b ? true : false);

        case E_MathOperation.NotEqualTo:
            return(a != b ? true : false);

        case E_MathOperation.GreaterThanOrEqualTo:
            return(a >= b ? true : false);

        case E_MathOperation.GreaterThan:
            return(a > b ? true : false);
        }
        return(false);
    }
Exemplo n.º 3
0
    public static string OperationString(E_MathOperation eOperation)
    {
        switch (eOperation)
        {
        case E_MathOperation.LessThan:
            return("<");

        case E_MathOperation.LessThanOrEqualTo:
            return("<=");

        case E_MathOperation.EqualTo:
            return("==");

        case E_MathOperation.NotEqualTo:
            return("!=");

        case E_MathOperation.GreaterThanOrEqualTo:
            return(">=");

        case E_MathOperation.GreaterThan:
            return(">");
        }
        return(string.Empty);
    }