mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
fix casting
This commit is contained in:
@@ -383,8 +383,8 @@ public class RobotContainer {
|
||||
|
||||
// * CommandChooser with BooleanSuppliers
|
||||
.whenPressed(new ComplexCommandChooser(new HashMap<Command, BooleanSupplier>() {{
|
||||
put(new RunClimberPath(m_robotClimber, m_robotClaws, new Point[] {new Point()}), () -> currentControlMode.equals(SubsystemMode.CLIMBER));
|
||||
put(new AimToCenter(m_robotTurret, m_robotSwerveDrive, m_robotVisionOdometry), () -> currentControlMode.equals(SubsystemMode.SHOOTER));
|
||||
put(new InstantCommand(() -> System.out.println("true")), () -> true);
|
||||
put(new InstantCommand(() -> System.out.println("false")), () -> false);
|
||||
}}));
|
||||
// .whenPressed(new CommandChooser(new RunClimberPath(m_robotClimber, m_robotClaws, new Point[] {new Point()}),
|
||||
// new AimToCenter(m_robotTurret, m_robotSwerveDrive, m_robotVisionOdometry),
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BasicCommandChooser extends CommandBase {
|
||||
Set<Subsystem> allReqs = c1.getRequirements();
|
||||
allReqs.addAll(c2.getRequirements());
|
||||
|
||||
addRequirements((Subsystem[]) allReqs.toArray());
|
||||
addRequirements(allReqs.toArray(Subsystem[]::new));
|
||||
}
|
||||
|
||||
public Command getTheChosenOne() {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ComplexCommandChooser extends CommandBase {
|
||||
for(Command command : commandMap.keySet())
|
||||
allReqs.addAll(command.getRequirements());
|
||||
|
||||
addRequirements((Subsystem[]) allReqs.toArray());
|
||||
addRequirements(allReqs.toArray(Subsystem[]::new));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user