Ejemplo n.º 1
0
        /// <summary>
        /// Removes top stack item and puts it in alt-stack. Return value indicates success.
        /// </summary>
        /// <param name="opData">Data to use</param>
        /// <param name="error">Error message (null if sucessful, otherwise will contain information about the failure)</param>
        /// <returns>True if operation was successful, false if otherwise</returns>
        public override bool Run(IOpData opData, out string error)
        {
            if (opData.ItemCount < 1)
            {
                error = "There was not enough items left in the stack to copy to alt-stack.";
                return(false);
            }

            opData.AltPush(opData.Pop());

            error = null;
            return(true);
        }
        /// <summary>
        /// Removes top stack item and puts it in alt-stack. Return value indicates success.
        /// </summary>
        /// <param name="opData">Data to use</param>
        /// <param name="error">Error message (null if sucessful, otherwise will contain information about the failure)</param>
        /// <returns>True if operation was successful, false if otherwise</returns>
        public override bool Run(IOpData opData, out string error)
        {
            if (opData.ItemCount < 1)
            {
                error = Err.OpNotEnoughItems;
                return(false);
            }

            opData.AltPush(opData.Pop());

            error = null;
            return(true);
        }