// RobotBuilder Version: 1.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.


package org.usfirst.frc330.Beachbot2014Java.commands;
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.command.CommandGroupUpdateable;
import org.usfirst.frc330.Beachbot2014Java.Robot;

/**
 *
 */
public class ConditionalHerd extends CommandGroupUpdateable {
    
    public  ConditionalHerd() {
        // Add Commands here:
        // e.g. addSequential(new Command1());
        //      addSequential(new Command2());
        // these will run in order.

        // To run multiple commands at the same time,
        // use addParallel()
        // e.g. addParallel(new Command1());
        //      addSequential(new Command2());
        // Command1 and Command2 will run in parallel.

        // A command group will require all of the subsystems that each member
        // would require.
        // e.g. if Command1 requires chassis, and Command2 requires arm,
        // a CommandGroup containing them would require both the chassis and the
        // arm.
    }
    
    protected void initialize() {
        super.initialize();
        if(Robot.pickup.isBallInPickup()){  //Herd
            addParallel(new PickupPulse());
            addSequential(new MoveArmToCloseLimit());
        }
        else {  //Move to safe
            addSequential(new PickupOff());
            addSequential(new MoveArmToCloseSafePosition());
        }
    }
}

@@ -25,13 +25,11 @@
  1.0
-%0D
 %0A//
-%0D
 %0A// 
@@ -92,17 +92,16 @@
 tions of
-%0D
 %0A// code
@@ -163,17 +163,16 @@
 builder.
-%0D
 %0A// Thes
@@ -230,17 +230,16 @@
 xport to
-%0D
 %0A// Java
@@ -299,17 +299,16 @@
 hange in
-%0D
 %0A// the 
@@ -368,17 +368,16 @@
 st on an
-%0D
 %0A// upda
@@ -437,17 +437,16 @@
  prevent
-%0D
 %0A// it f
@@ -481,13 +481,10 @@
 ure.
-%0D%0A%0D%0A%0D
+%0A%0A
 %0Apac
@@ -533,17 +533,16 @@
 ommands;
-%0D
 %0Aimport 
@@ -584,17 +584,16 @@
 ndGroup;
-%0D
 %0Aimport 
@@ -645,17 +645,16 @@
 ateable;
-%0D
 %0Aimport 
@@ -699,25 +699,20 @@
 bot;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A *
-%0D
 %0A */
-%0D
 %0Apub
@@ -769,23 +769,21 @@
 teable %7B
-%0D
 %0A    
-%0D
 %0A    pub
@@ -802,25 +802,24 @@
 onalHerd() %7B
-%0D
 %0A        // 
@@ -836,17 +836,16 @@
 ds here:
-%0D
 %0A       
@@ -875,33 +875,32 @@
 new Command1());
-%0D
 %0A        //     
@@ -922,33 +922,32 @@
 new Command2());
-%0D
 %0A        // thes
@@ -966,19 +966,17 @@
 n order.
-%0D%0A%0D
+%0A
 %0A       
@@ -1021,17 +1021,16 @@
 me time,
-%0D
 %0A       
@@ -1050,17 +1050,16 @@
 rallel()
-%0D
 %0A       
@@ -1091,25 +1091,24 @@
 Command1());
-%0D
 %0A        // 
@@ -1138,25 +1138,24 @@
 Command2());
-%0D
 %0A        // 
@@ -1201,11 +1201,9 @@
 lel.
-%0D%0A%0D
+%0A
 %0A   
@@ -1277,17 +1277,16 @@
 h member
-%0D
 %0A       
@@ -1303,17 +1303,16 @@
 require.
-%0D
 %0A       
@@ -1376,17 +1376,16 @@
 res arm,
-%0D
 %0A       
@@ -1457,17 +1457,16 @@
  and the
-%0D
 %0A       
@@ -1477,22 +1477,80 @@
 arm.
-%0D
+%0A        requires(Robot.arm);%0A        requires(Robot.pickup);
 %0A    %7D
-%0D
 %0A    
-%0D
 %0A   
@@ -1579,17 +1579,16 @@
 lize() %7B
-%0D
 %0A       
@@ -1607,17 +1607,16 @@
 alize();
-%0D
 %0A       
@@ -1658,17 +1658,16 @@
   //Herd
-%0D
 %0A       
@@ -1698,25 +1698,24 @@
 kupPulse());
-%0D
 %0A           
@@ -1752,25 +1752,24 @@
 oseLimit());
-%0D
 %0A        %7D%0D%0A
@@ -1762,25 +1762,24 @@
 );%0A        %7D
-%0D
 %0A        els
@@ -1797,17 +1797,16 @@
  to safe
-%0D
 %0A       
@@ -1837,25 +1837,24 @@
 ickupOff());
-%0D
 %0A           
@@ -1902,17 +1902,16 @@
 tion());
-%0D
 %0A       
@@ -1916,16 +1916,13 @@
    %7D
-%0D
 %0A    %7D
-%0D
 %0A%7D
-%0D
 %0A

add requires to ConditionalHerd