fCraft.Expression.Print C# (CSharp) Method

Print() public method

public Print ( ) : string
return string
        public string Print()
        {
            var stack = new Stack<string>();
            foreach ( IExpressionElement e in _expression )
                e.Print( stack );
            return stack.Pop();
        }

Same methods

Expression::Print ( Stack stack ) : void

Usage Example

        protected FuncDrawOperation(Player player, Command cmd)
            : base(player)
        {
            string strFunc = cmd.Next();
            if (string.IsNullOrWhiteSpace(strFunc))
            {
                player.Message("&WEmpty function expression");
                return;
            }
            if (strFunc.Length < 3)
            {
                player.Message("&WExpression is too short (should be like z=f(x,y))");
                return;
            }

            strFunc = strFunc.ToLower();

            _vaxis = GetAxis(SimpleParser.PreparseAssignment(ref strFunc));

            _expression = SimpleParser.Parse(strFunc, GetVarArray(_vaxis));

            Player.Message("Expression parsed as "+_expression.Print());
            string scalingStr=cmd.Next();
            _scaler = new Scaler(scalingStr);
        }
All Usage Examples Of fCraft.Expression::Print