fCraft.Expression.IsInEquality C# (CSharp) Method

IsInEquality() public method

public IsInEquality ( ) : bool
return bool
        public bool IsInEquality()
        {
            IExpressionElement e = _expression.Last();
            return ( e is Less ) || ( e is Greater );
        }

Usage Example

Example #1
0
        public InequalityDrawOperation(Player player, Command cmd)
            : base(player)
        {
            string strFunc = cmd.Next();

            if (string.IsNullOrWhiteSpace(strFunc))
            {
                throw new ArgumentException("empty inequality expression");
            }
            if (strFunc.Length < 3)
            {
                throw new ArgumentException("expression is too short (should be like f(x,y,z)>g(x,y,z))");
            }

            strFunc = strFunc.ToLower();

            _expression = SimpleParser.Parse(strFunc, new string[] { "x", "y", "z" });
            if (!_expression.IsInEquality())
            {
                throw new ArgumentException(
                          "the expression given is not an inequality (should be like f(x,y,z)>g(x,y,z))");
            }

            player.Message("Expression parsed as " + _expression.Print());
            string scalingStr = cmd.Next();

            _scaler = new Scaler(scalingStr);
        }
All Usage Examples Of fCraft.Expression::IsInEquality