Example #1
0
        /// <summary>
        /// Triggers a CancelCommand for the given <paramref name="node"/>
        /// </summary>
        /// <param name="node">Node to cancel from the queue</param>
        public void removeManeuverCommandByNode(ManeuverNode node)
        {
            if (mCommandQueue.Count <= 0)
            {
                return;
            }

            // look for ManeuverCommands
            for (int i = this.mCommandQueue.Count - 1; i >= 0; i--)
            {
                if (this.mCommandQueue[i] is ManeuverCommand && ((ManeuverCommand)this.mCommandQueue[i]).Node == node)
                {
                    // remove Node
                    this.Enqueue(CancelCommand.WithCommand((ManeuverCommand)this.mCommandQueue[i]));
                    return;
                }
            }
        }
Example #2
0
        /// <summary>Triggers a <see cref="CancelCommand"/> for the given <paramref name="node"/></summary>
        /// <param name="node">Node to cancel from the queue</param>
        public void RemoveManeuverCommandByNode(ManeuverNode node)
        {
            if (_commandQueue.Count <= 0)
            {
                return;
            }

            // look for ManeuverCommands
            for (var i = _commandQueue.Count - 1; i >= 0; i--)
            {
                var maneuverCmd = _commandQueue[i] as ManeuverCommand;
                if (maneuverCmd != null && maneuverCmd.Node == node)
                {
                    // remove Node
                    Enqueue(CancelCommand.WithCommand(maneuverCmd));
                    return;
                }
            }
        }
Example #3
0
        public IEnumerator OnClickCancel(ICommand c)
        {
            yield return(null);

            mFlightComputer.Enqueue(CancelCommand.WithCommand(c));
        }