package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.hardware.DcMotor;

public class MovementAPI {
    private final Hardware hardware;

    public MovementAPI(Hardware hardware) {
        this.hardware = hardware;
    }

    public void move(MotorPowers powers) {
        hardware.fl.setPower(powers.fl);
        hardware.fr.setPower(powers.fr);
        hardware.bl.setPower(powers.bl);
        hardware.br.setPower(powers.br);
    }

    public void move(double powerX, double powerY, double turn, double speed) {
        this.move(MotorPowers.calculate(powerX, powerY, turn, speed));
    }

    public void stop() {
        hardware.fl.setPower(0);
        hardware.fr.setPower(0);
        hardware.bl.setPower(0);
        hardware.br.setPower(0);
    }
}