package org.camsrobotics.frc2016.auto;

import org.camsrobotics.frc2016.HardwareAdapter;
import org.camsrobotics.frc2016.auto.actions.Action;
import org.camsrobotics.frc2016.subsystems.Drive;
import org.camsrobotics.frc2016.subsystems.Intake;
import org.camsrobotics.frc2016.subsystems.Lifter;
import org.camsrobotics.frc2016.subsystems.Shooter;

/**
 * Base class for Autonomous modes
 * 
 * @author Wesley
 *
 */
public abstract class AutoMode {
	protected Drive drive = HardwareAdapter.kDrive;
	protected Shooter shooter = HardwareAdapter.kShooter;
	protected Intake intake = HardwareAdapter.kIntake;
	protected Lifter lifter = HardwareAdapter.kLifter;
	
	private double m_rate = 1/50;
	private boolean m_enabled = false;

	public abstract void run();
	
	public void stop()	{
		m_enabled = false;
	}
	
	public boolean isEnabled()	{
		return m_enabled;
	}
	
	public void runAction(Action a) throws Exception	{
		if(!m_enabled)	{
			throw new Exception("The Auto Mode has ended!");
		}
		
		a.start();
		while(isEnabled() && !a.isFinished())	{
			a.update();
			Thread.sleep((long) m_rate * 1000);
		}
	}
}

@@ -945,17 +945,16 @@
 %7B%0D%0A%09%09if(
-!
 m_enable
@@ -961,72 +961,12 @@
 d)%09%7B
-%0D%0A%09%09%09throw new Exception(%22The Auto Mode has ended!%22);%0D%0A%09%09%7D%0D%0A%09
 %09%0D%0A
+%09
 %09%09a.
@@ -975,16 +975,17 @@
 art();%0D%0A
+%09
 %09%09while(
@@ -1022,16 +1022,17 @@
 )%09%7B%0D%0A%09%09%09
+%09
 a.update
@@ -1036,16 +1036,17 @@
 ate();%0D%0A
+%09
 %09%09%09Threa
@@ -1077,16 +1077,22 @@
 1000);%0D%0A
+%09%09%09%7D%0D%0A
 %09%09%7D%0D%0A%09%7D%0D

Remove the exception