package org.usfirst.frc2084.CMonster2014.drive;

import edu.wpi.first.wpilibj.SpeedController;

/**
 *
 * @author Ben Wolsieffer
 */
public class WheelController {

    protected SpeedController[] motors;
    private double inverted = 1;

    public WheelController(SpeedController motor) {
        this(new SpeedController[]{
            motor
        });
    }

    public WheelController(SpeedController motor, SpeedController motor2) {
        this(new SpeedController[]{
            motor,
            motor2
        });
    }

    public WheelController(SpeedController[] motors) {
        this.motors = motors;
    }

    public void set(double speed) {
        speed = DriveUtils.limit(speed) * inverted;
        for (int i = 0; i < motors.length; i++) {
            motors[i].set(speed);
        }
    }

    public void setInverted(boolean inverted) {
        this.inverted = inverted ? -1 : 1;
    }

    public boolean isInverted() {
        return inverted == -1;
    }
}

@@ -99,144 +99,565 @@
 *%0A *
-%0A * @author Ben Wolsieffer%0A */%0Apublic class WheelController %7B%0A%0A    protected SpeedController%5B%5D motors;%0A    private double inverted = 1;%0A
+ Controls a single wheel with an arbitrary number of motors. In many cases%0A * this will actually control a single wheel, but in designs where two wheels%0A * are connected to the same gearbox (such as most tank drive systems), it will%0A * actually control two wheels.%0A *%0A * @author Ben Wolsieffer%0A */%0Apublic class WheelController %7B%0A%0A    protected SpeedController%5B%5D motors;%0A    private double inverted = 1;%0A%0A    /**%0A     * Creates a new %7B@link WheelController%7D with one motor.%0A     *%0A     * @param motor the %7B@link SpeedController%7D that powers the wheel%0A     */
 %0A   
@@ -744,45 +744,256 @@
 r%5B%5D%7B
+motor%7D);
 %0A    
+%7D%0A%0A
     
-   
+/**%0A     * Creates a new %7B@link WheelController%7D with two
  motor
+s.
 %0A     
+*%0A
    
-%7D);%0A    %7D%0A
+  * @param motor the %7B@link SpeedController%7D that powers the wheel%0A     * @param motor2 the second %7B@link SpeedController%7D that powers the wheel%0A     */
 %0A   
@@ -1104,65 +1104,878 @@
 r%5B%5D%7B
+motor, motor2%7D);
 %0A    
+%7D%0A%0A
     
-    motor,
+/**%0A     * Creates a new %7B@link WheelController%7D with three motors.%0A     *%0A     * @param motor the %7B@link SpeedController%7D that powers the wheel%0A     * @param motor2 the second %7B@link SpeedController%7D that powers the wheel%0A     * @param motor3 the third %7B@link SpeedController%7D that powers the wheel
 %0A     
+*/%0A
     
-   motor2%0A        %7D);%0A    %7D%0A
+public WheelController(SpeedController motor, SpeedController motor2, SpeedController motor3) %7B%0A        this(new SpeedController%5B%5D%7Bmotor, motor2, motor3%7D);%0A    %7D%0A%0A    /**%0A     * Creates a new %7B@link WheelController%7D with an arbitrary number of motors.%0A     * This constructor is only necessary if one wheel has more than 3 motors%0A     * (which seems unlikely), otherwise use the 1, 2, or 3 parameter versions%0A     * of the constructor.%0A     *%0A     * @param motors the array of %7B@link SpeedController%7D that powers the wheel%0A     */
 %0A   

Add documentation to WheelController