package org.usfirst.frc178.devices;

import edu.wpi.first.wpilibj.Solenoid;
/**
 *
 * @author Administrator
 */
public class Pneumatics 
{
		public Solenoid frisbeeLoader, shifter, shifterLow;

	public Pneumatics()
	{
		//module defaults to 3
		frisbeeLoader = new Solenoid(1);
		shifter = new Solenoid(2);
		shifterLow = new Solenoid(3);
	}

	public boolean shift()
	{
		shifter.set(!shifter.get());
		return shifter.get();

	}
	public boolean shiftTo(boolean shiftTo)
	{
		shifter.set(shiftTo);
		return shifter.get();
	}
	private int getGear()
	{
		if(shifter.get())
		{
			return 1;
		}
		else
		{
			return 2;
		}
	}
	public int setBothGears(int gear)
	{
		if(gear > 2 || gear < 0)
		{
			return -1;
		}
		else if(gear == 1)
		{
			shifter.set(false);
			return getGear();
		}
		else	//gear == 2
		{
			shifter.set(true);
			return getGear();
		}
	}
	public int resetGears()	//resets both gears to first gear
	{
		return setBothGears(1);
	}
}
@@ -133,12 +133,12 @@
 ics 
-%0A%7B%0A%09
+ %7B%0A%0A
 %09pub
@@ -418,24 +418,25 @@
 .get();%0A%0A%09%7D%0A
+%0A
 %09public bool
@@ -518,16 +518,17 @@
 t();%0A%09%7D%0A
+%0A
 %09private
@@ -609,32 +609,33 @@
 eturn 2;%0A%09%09%7D%0A%09%7D%0A
+%0A
 %09public int setB
@@ -652,24 +652,43 @@
 nt gear)
-%0A%09%7B
+ %7B%0A%0A%09%09// Check bounds
 %0A%09%09if
+ 
 (gear %3E 
@@ -705,40 +705,147 @@
 %3C 0)
-%0A%09%09
+ 
 %7B%0A%09%09%09
-return -1
+throw new IllegalArgumentException(%22Only gears of first and second can be set%22)
 ;%0A%09%09%7D%0A
+%0A
 %09%09
-else if
+// Why is this not setting shifterLow?%0A%0A%09%09if 
 (gea
@@ -851,20 +851,45 @@
 ar == 1)
+ %7B
 %0A%09%09
-%7B
+%09// Switch to first gear
 %0A%09%09%09shif
@@ -932,31 +932,43 @@
 %0A%09%09%7D
-%0A%09%09
+ 
 else
-%09//gear == 2%0A%09%09%7B
+ %7B%0A%09%09%09// Switch to second gear
 %0A%09%09%09
@@ -1015,39 +1015,23 @@
 %09%09%7D%0A
+%0A
 %09%7D%0A
-%09public int resetGears()%09//r
+%0A%09/**%0A%09 * R
 eset
@@ -1057,16 +1057,46 @@
 st gear%0A
+%09 */%0A%09public int resetGears()%0A
 %09%7B%0A%09%09ret

Throw an exception instead of returning -1