src/main/java/frc/team5431/titan/core/robot/legacy/CommandQueue.java
public boolean update(final T robot) {
        if (isEmpty()) {
            return false;
        }

        final Command<T> command = peek();
        final Command.CommandResult result = command.update(robot);
        if (result == Command.CommandResult.IN_PROGRESS) {
            return true;
        } else {
            final double secondsElapsed = command.getSecondsElapsed();
            Logger.l("Finished %s (Seconds: %.2f)", command.getName(), secondsElapsed);
            command.done(robot);
            if (result == Command.CommandResult.COMPLETE) {
                remove();
                final Command<T> nextCommand = peek();
                if (nextCommand != null) {
                    nextCommand.startTimer();
                    nextCommand.init(robot);
                    Logger.l("Starting %s (%s)", nextCommand.getName(), nextCommand.getProperties());
                } else {
                    return false;
                }
            } else if (result == Command.CommandResult.CLEAR_QUEUE) {
                clear();
                Logger.l("Cleared queue");
            } else if (result == Command.CommandResult.RESTART_COMMAND) {
                command.startTimer();
                command.init(robot);
            }
        }

        return true;
    }
/*
     * Returns false if there are no more steps to complete
     */
Returns false if there are no more steps to complete
Returns false if there are no more steps to complete
public boolean update(final T robot) {
        if (isEmpty()) {
            return false;
        }
        final Command<T> command = peek();
        final Command.CommandResult result = command.update(robot);
        if (result == Command.CommandResult.IN_PROGRESS) {
            return true;
        } else {
            final double secondsElapsed = command.getSecondsElapsed();
            Logger.l("Finished %s (Seconds: %.2f)", command.getName(), secondsElapsed);
            command.done(robot);
            if (result == Command.CommandResult.COMPLETE) {
                remove();
                final Command<T> nextCommand = peek();
                if (nextCommand != null) {
                    nextCommand.startTimer();
                    nextCommand.init(robot);
                    Logger.l("Starting %s (%s)", nextCommand.getName(), nextCommand.getProperties());
                } else {
                    return false;
                }
            } else if (result == Command.CommandResult.CLEAR_QUEUE) {
                clear();
                Logger.l("Cleared queue");
            } else if (result == Command.CommandResult.RESTART_COMMAND) {
                command.startTimer();
                command.init(robot);
            }
        }
        return true;
    }
public boolean update ( final T robot ) { if ( isEmpty ( ) ) { return false ; } final Command < T > command = peek ( ) ; final Command . CommandResult result = command . update ( robot ) ; if ( result == Command . CommandResult . IN_PROGRESS ) { return true ; } else { final double secondsElapsed = command . getSecondsElapsed ( ) ; Logger . l ( "Finished %s (Seconds: %.2f)" , command . getName ( ) , secondsElapsed ) ; command . done ( robot ) ; if ( result == Command . CommandResult . COMPLETE ) { remove ( ) ; final Command < T > nextCommand = peek ( ) ; if ( nextCommand != null ) { nextCommand . startTimer ( ) ; nextCommand . init ( robot ) ; Logger . l ( "Starting %s (%s)" , nextCommand . getName ( ) , nextCommand . getProperties ( ) ) ; } else { return false ; } } else if ( result == Command . CommandResult . CLEAR_QUEUE ) { clear ( ) ; Logger . l ( "Cleared queue" ) ; } else if ( result == Command . CommandResult . RESTART_COMMAND ) { command . startTimer ( ) ; command . init ( robot ) ; } } return true ; }
Returns false if there are no more steps to complete
Returns false if there are no more steps to complete