/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.team225.robot2014.commands;

import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;
import org.team225.robot2014.CommandBase;
import org.team225.robot2014.commands.autonomous.OneBall;

/**
 *
 * @author Andrew
 */
public class AutonomousWrapper {
    Class autonomous = null;
    String description = "";
    boolean caresAboutHotGoal = false;
    static boolean startingGoalIsHot = false;
    
    public AutonomousWrapper(Class autonomous, String description, boolean caresAboutHotGoal)
    {
        this.autonomous = autonomous;
        
        if ( description == null )
            this.description = autonomous.getName();
        else 
            this.description = description;
        
        this.caresAboutHotGoal = caresAboutHotGoal;
    }
    
    public String getDescription()
    {
        return description;
    }
    
    public Command start()
    {   
        if ( caresAboutHotGoal )
        {
            Timer.delay(0.5);
            AutonomousWrapper.startingGoalIsHot = CommandBase.piComm.getBoolean("hasTarget");
        }
        
        Command command = null;
        try
        {
            command = (Command) autonomous.newInstance(); 
        } catch (Exception e) {
            System.out.println("Failed to start command, falling back to OneBall");
            command = new OneBall();
        }
        command.start();
        return command;
    }
}

@@ -1,10 +1,11 @@
 /*
+%0D
 %0A * To c
@@ -49,16 +49,17 @@
 emplates
+%0D
 %0A * and 
@@ -90,20 +90,22 @@
  editor.
+%0D
 %0A */
+%0D
 %0Apackage
@@ -136,17 +136,19 @@
 ommands;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -175,16 +175,17 @@
 j.Timer;
+%0D
 %0Aimport 
@@ -222,16 +222,17 @@
 Command;
+%0D
 %0Aimport 
@@ -265,16 +265,17 @@
 andBase;
+%0D
 %0Aimport 
@@ -328,16 +328,20 @@
 all;
-%0A
+%0D%0A%0D
 %0A/**
+%0D
 %0A *
+%0D
 %0A * 
@@ -354,20 +354,22 @@
 r Andrew
+%0D
 %0A */
+%0D
 %0Apublic 
@@ -393,16 +393,17 @@
 rapper %7B
+%0D
 %0A    Cla
@@ -419,24 +419,25 @@
 mous = null;
+%0D
 %0A    String 
@@ -453,16 +453,17 @@
 on = %22%22;
+%0D
 %0A    boo
@@ -489,24 +489,25 @@
 oal = false;
+%0D
 %0A    static 
@@ -540,21 +540,23 @@
 = false;
+%0D
 %0A    
+%0D
 %0A    pub
@@ -641,22 +641,24 @@
 HotGoal)
+%0D
 %0A    %7B
+%0D
 %0A       
@@ -687,16 +687,17 @@
 onomous;
+%0D
 %0A       
@@ -689,32 +689,33 @@
 omous;%0D%0A        
+%0D
 %0A        if ( de
@@ -733,16 +733,17 @@
 = null )
+%0D
 %0A       
@@ -787,16 +787,17 @@
 tName();
+%0D
 %0A       
@@ -802,16 +802,17 @@
    else 
+%0D
 %0A       
@@ -843,24 +843,25 @@
 description;
+%0D
 %0A        %0A  
@@ -849,32 +849,33 @@
 ption;%0D%0A        
+%0D
 %0A        this.ca
@@ -910,27 +910,30 @@
 HotGoal;
+%0D
 %0A    %7D
+%0D
 %0A    
+%0D
 %0A    pub
@@ -959,22 +959,24 @@
 iption()
+%0D
 %0A    %7B
+%0D
 %0A       
@@ -999,19 +999,22 @@
 ion;
+%0D
 %0A    %7D
+%0D
 %0A    
+%0D
 %0A   
@@ -1036,16 +1036,17 @@
  start()
+%0D
 %0A    %7B  
@@ -1046,16 +1046,17 @@
     %7B   
+%0D
 %0A       
@@ -1080,16 +1080,17 @@
 otGoal )
+%0D
 %0A       
@@ -1083,32 +1083,47 @@
 oal )%0D%0A        %7B
+%0D%0A            %0D
 %0A            Tim
@@ -1136,16 +1136,17 @@
 ay(0.5);
+%0D
 %0A       
@@ -1231,16 +1231,17 @@
 arget%22);
+%0D
 %0A       
@@ -1234,32 +1234,33 @@
 et%22);%0D%0A        %7D
+%0D
 %0A        %0A      
@@ -1252,16 +1252,17 @@
         
+%0D
 %0A       
@@ -1285,16 +1285,17 @@
  = null;
+%0D
 %0A       
@@ -1298,16 +1298,17 @@
      try
+%0D
 %0A       
@@ -1309,16 +1309,17 @@
        %7B
+%0D
 %0A       
@@ -1369,16 +1369,17 @@
 ance(); 
+%0D
 %0A       
@@ -1402,16 +1402,17 @@
 ion e) %7B
+%0D
 %0A       
@@ -1487,16 +1487,17 @@
 eBall%22);
+%0D
 %0A       
@@ -1525,16 +1525,17 @@
 eBall();
+%0D
 %0A       
@@ -1536,16 +1536,17 @@
        %7D
+%0D
 %0A       
@@ -1562,16 +1562,17 @@
 start();
+%0D
 %0A       
@@ -1591,13 +1591,16 @@
 and;
+%0D
 %0A    %7D
+%0D
 %0A%7D
+%0D
 %0A

Test commit from netbeans