package net.miarma.hystuff.common;

import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector3f;

import javax.annotation.Nonnull;

public record Location(@Nonnull String worldName, double x,
                       double y, double z, float yaw, float pitch) {
    public Location(@Nonnull String worldName, double x, double y, double z, float yaw, float pitch) {
        this.worldName = worldName;
        this.x = x;
        this.y = y;
        this.z = z;
        this.yaw = yaw;
        this.pitch = pitch;
    }

    public Vector3d toPosition() {
        return new Vector3d(this.x, this.y, this.z);
    }

    public Vector3f toRotation() {
        return new Vector3f(this.yaw, this.pitch, 0.0F);
    }

    @Nonnull
    public String worldName() {
        return this.worldName;
    }

    public double x() {
        return this.x;
    }

    public double y() {
        return this.y;
    }

    public double z() {
        return this.z;
    }

    public float yaw() {
        return this.yaw;
    }

    public float pitch() {
        return this.pitch;
    }
}
