Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Create IntakeOrOuttakeConeOrCube.java
Browse files Browse the repository at this point in the history
  • Loading branch information
3LucasZ committed Oct 5, 2023
1 parent 3839058 commit f036697
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package frc.robot.intake.commands;

import edu.wpi.first.wpilibj2.command.ConditionalCommand;
import frc.robot.helpers.ParentCommand;
import frc.robot.intake.Intake;

import java.util.function.BooleanSupplier;

public class IntakeOrOuttakeConeOrCube extends ParentCommand{
private final Intake intakeSubsystem;
private final boolean isIntake;
private final BooleanSupplier isCone;

public IntakeOrOuttakeConeOrCube(Intake intakeSubsystem,boolean isIntake,BooleanSupplier isCone){
super();
this.intakeSubsystem=intakeSubsystem;
this.isIntake=isIntake;
this.isCone=isCone;
addRequirements(intakeSubsystem);
}

@Override
public void initialize(){
if(isIntake){
addChildCommands(
new ConditionalCommand(new IntakeCone(intakeSubsystem),new IntakeCube(intakeSubsystem),isCone));

}else{
addChildCommands(
new ConditionalCommand(new OuttakeCone(intakeSubsystem),new OuttakeCube(intakeSubsystem),isCone));
}
super.initialize();
}
}

0 comments on commit f036697

Please sign in to comment.