package top.r3944realms.lib39.client.model;

import net.minecraft.client.model.geom.PartPose;
import net.minecraft.resources.Identifier;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
import top.r3944realms.lib39.Lib39;

/**
 * The enum Doll poses.
 */
public enum DollPoses implements IDollPose{
    /**
     * Default doll poses.
     */
    DEFAULT(
            "default",
            PartPose.offset(0.0F, 9.0F, 0.0F),
            PartPose.offset(0.0F, 9.0F, 0.0F),
            PartPose.offsetAndRotation(-5.0F, 11.0F, 0.0F, 0.0F, 0.0F, 0.3927F),
            PartPose.offsetAndRotation(5.0F, 11.0F, 0.0F, 0.0F, 0.0F, -0.3927F),
            PartPose.offsetAndRotation(-2.0F, 19.0F, -2.0F, -1.5708F, 0.3927F, 0.0F),
            PartPose.offsetAndRotation(2.0F, 19.0F, -2.0F, -1.5708F, -0.3927F, 0.0F)
    );
    // 注册全局？
    private final Identifier id;
    private final Vec3 offset;
    private final PartPose headPose;
    private final PartPose bodyPose;
    private final PartPose rightArmPose;
    private final PartPose leftArmPose;
    private final PartPose rightLegPose;
    private final PartPose leftLegPose;

    DollPoses(String name, PartPose headPose, PartPose bodyPose,
              PartPose rightArmPose, PartPose leftArmPose,
              PartPose rightLegPose, PartPose leftLegPose) {
      this(name, Vec3.ZERO, headPose, bodyPose, rightArmPose, leftArmPose, rightLegPose, leftLegPose);
    }

    DollPoses(String name, Vec3 offset, PartPose headPose, PartPose bodyPose,
             PartPose rightArmPose, PartPose leftArmPose,
             PartPose rightLegPose, PartPose leftLegPose) {
        this.id = Lib39.rl(name);
        this.offset = offset;
        this.headPose = headPose;
        this.bodyPose = bodyPose;
        this.rightArmPose = rightArmPose;
        this.leftArmPose = leftArmPose;
        this.rightLegPose = rightLegPose;
        this.leftLegPose = leftLegPose;
    }

    @Override
    public @NotNull Identifier getId() {
        return id;
    }

    @Override
    public PartPose getHeadPose() {
        return headPose;
    }

    @Override
    public PartPose getBodyPose() {
        return bodyPose;
    }

    @Override
    public PartPose getRightArmPose() {
        return rightArmPose;
    }

    @Override
    public PartPose getLeftArmPose() {
        return leftArmPose;
    }

    @Override
    public PartPose getRightLegPose() {
        return rightLegPose;
    }

    @Override
    public PartPose getLeftLegPose() {
        return leftLegPose;
    }

    @Override
    public @NotNull Vec3 getTotalOffset() {
        return offset;
    }
}
