package org.firstinspires.ftc.teamcode.reorg;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

@Autonomous(name="auto-test-facade", group="Robot")
public class AutonomousTestFacade extends LinearOpMode {

    @Override
    public void runOpMode() {
        /*
        Class where all our initialization code lives
        To use it, we just instantiate a copy of it!
         */
        AutonomousTestService service = new AutonomousTestService(hardwareMap);

        /*
        Initialize the hardware stuff
         */
        service.initializeHardware(); // good

        /*
        There's a sleep here, need to determine if it's needed
        sleep(1000);
         */


        /*
        Initialize the direction stuff
         */
        service.initializeDirection(); // good

        /*
        Stop and reset all encoders
         */
        service.initializeEncoders(); // good

        /*
        Update telemetry
         */
        telemetry.update();

        /*
        From the JavaDoc: Pauses the Linear Op Mode until start has been pressed
                          or until the current thread is interrupted.
         */
        waitForStart();
        {
            service.execute(opModeIsActive(), telemetry);
        }
    }
}
