Example #1
0
        /// <summary>
        /// Removes top alt-stack item and puts it in 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.AltItemCount < 1)
            {
                error = "There was not enough items left in the alt-stack to copy to stack.";
                return(false);
            }

            opData.Push(opData.AltPop());

            error = null;
            return(true);
        }
        /// <summary>
        /// Removes top alt-stack item and puts it in 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.AltItemCount < 1)
            {
                error = Err.OpNotEnoughItems + "(alt stack)";
                return(false);
            }

            opData.Push(opData.AltPop());

            error = null;
            return(true);
        }