This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create IntakeOrOuttakeConeOrCube.java
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/main/java/frc/robot/intake/commands/IntakeOrOuttakeConeOrCube.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |