package org.firstinspires.ftc.teamcode;

public abstract class AutonFour extends LinearOpModeWithMovement {
    public abstract void runOpMode();

    public void run(boolean blue) {
        if (System.currentTimeMillis() > -1) throw new RuntimeException("Not yet implemented");

        this.construct(true);

        movement.setFlipped(!blue);

        api.print("Status", "Initializing, please wait");
//        motors.lift.setDirection(API.Direction.REVERSE, false);

        api.clear();
        api.print("Press play to start");

        waitForStart();

        movement.move(-180, 0.4, true);
        api.pause(0.7);
        movement.stop();
//        motors.lift.start(0.25);
        api.pause(3);
//        motors.lift.stop();
//        motors.lift.start(-0.25);
        api.pause(2.5);
//        motors.lift.stop();
        movement.move(0, 0.4, true);
        api.pause(1);
        movement.move(90, 0.4, true);
        api.pause(3);
        movement.move(-180, 0.4, true);
        api.pause(1);
        movement.move(90, 0.4, true);
        api.pause(1);
        movement.move(0, 0.2, true);
        api.pause(1.6);
        movement.move(45, 0.1, true);
        motors.carousel.start(0.6 * (blue ? 1 : -1));
        api.pause(5);
        motors.carousel.stop();
        movement.move(180, 0.4, true);
        api.pause(blue ? 0.47 : 0.6);
        movement.stop();

        api.thr.isRunning = false;
    }
}
