package top.r3944realms.eroticdungeongame.content.animation;

import dev.kosmx.playerAnim.core.data.KeyframeAnimation;

@SuppressWarnings("unused")
public class AnimationProperties {
    private int animationIndex;
    private int layerLevel;
    private float camYaw;
    private float camPitch;
    private float camRoll;
    private float camY;
    private float jumpModifier;
    private float heightModifier;
    private String animationName;
    private KeyframeAnimation animation;
    private boolean swapRotation;
    private boolean invertX;
    private boolean invertY;
    private boolean invertView;
    private Integer up;
    private Integer down;
    private Integer left;
    private Integer right;
    private Integer forward;
    private Integer back;

    public enum KeyOfSwitchPose {
        DOWN,
        UP,
        LEFT,
        RIGHT,
        FORWARD,
        BACK
    }
    @SuppressWarnings("unused")
    public static class Builder {
        private int animationIndex;
        private int layerLevel;
        private float camYaw;
        private float camPitch;
        private float camRoll;
        private float camY;
        private float jumpModifier = 1.0f;
        private float heightModifier = 1.0f;
        private String animationName;
        private KeyframeAnimation animation;
        private boolean swapRotation = false;
        private boolean invertX = false;
        private boolean invertY = false;
        private boolean invertView = false;
        private Integer up;
        private Integer down;
        private Integer left;
        private Integer right;
        private Integer forward;
        private Integer back;

        public Builder withAnimationIndex(int animationIndex) {
            this.animationIndex = animationIndex;
            return this;
        }

        public Builder withLayerLevel(int layerLevel) {
            this.layerLevel = layerLevel;
            return this;
        }

        public Builder withCamYaw(float camYaw) {
            this.camYaw = camYaw;
            return this;
        }

        public Builder withCamPitch(float camPitch) {
            this.camPitch = camPitch;
            return this;
        }

        public Builder withCamRoll(float camRoll) {
            this.camRoll = camRoll;
            return this;
        }

        public Builder withCamY(float camY) {
            this.camY = camY;
            return this;
        }

        public Builder withJumpModifier(float jumpModifier) {
            this.jumpModifier = jumpModifier;
            return this;
        }

        public Builder withHeightModifier(float heightModifier) {
            this.heightModifier = heightModifier;
            return this;
        }

        public Builder withAnimationName(String animationName) {
            this.animationName = animationName;
            return this;
        }

        public Builder withAnimation(KeyframeAnimation animation) {
            this.animation = animation;
            return this;
        }

        public Builder withSwapRotation(boolean swapRotation) {
            this.swapRotation = swapRotation;
            return this;
        }

        public Builder withInvertX(boolean invertX) {
            this.invertX = invertX;
            return this;
        }

        public Builder withInvertY(boolean invertY) {
            this.invertY = invertY;
            return this;
        }

        public Builder withInvertView(boolean invertView) {
            this.invertView = invertView;
            return this;
        }

        public Builder withUp(Integer up) {
            this.up = up;
            return this;
        }

        public Builder withDown(Integer down) {
            this.down = down;
            return this;
        }

        public Builder withLeft(Integer left) {
            this.left = left;
            return this;
        }

        public Builder withRight(Integer right) {
            this.right = right;
            return this;
        }

        public Builder withForward(Integer forward) {
            this.forward = forward;
            return this;
        }

        public Builder withBack(Integer back) {
            this.back = back;
            return this;
        }

        public Builder withAdjacent(Integer up, Integer down, Integer left, Integer right, Integer forward, Integer back) {
            this.up = up;
            this.down = down;
            this.left = left;
            this.right = right;
            this.forward = forward;
            this.back = back;
            return this;
        }

        public AnimationProperties build() {
            AnimationProperties properties = new AnimationProperties();
            properties.animationIndex = this.animationIndex;
            properties.layerLevel = this.layerLevel;
            properties.camYaw = this.camYaw;
            properties.camPitch = this.camPitch;
            properties.camRoll = this.camRoll;
            properties.camY = this.camY;
            properties.jumpModifier = this.jumpModifier;
            properties.heightModifier = this.heightModifier;
            properties.animationName = this.animationName;
            properties.animation = this.animation;
            properties.swapRotation = this.swapRotation;
            properties.invertX = this.invertX;
            properties.invertY = this.invertY;
            properties.invertView = this.invertView;
            properties.up = this.up;
            properties.down = this.down;
            properties.left = this.left;
            properties.right = this.right;
            properties.forward = this.forward;
            properties.back = this.back;
            return properties;
        }
    }

    // 添加静态方法创建 Builder
    public static Builder builder() {
        return new Builder();
    }

    public AnimationProperties() {
        this.jumpModifier = 1.0f;
        this.heightModifier = 1.0f;
        this.swapRotation = false;
        this.invertX = false;
        this.invertY = false;
        this.invertView = false;
    }


    public AnimationProperties withLayerLevel(int layerLevel) {
        this.layerLevel = layerLevel;
        return this;
    }

    public AnimationProperties withAnimationIndex(int animationIndex) {
        this.animationIndex = animationIndex;
        return this;
    }

    public AnimationProperties withCamYaw(float camYaw) {
        this.camYaw = camYaw;
        return this;
    }

    public AnimationProperties withCamPitch(float camPitch) {
        this.camPitch = camPitch;
        return this;
    }

    public AnimationProperties withCamRoll(float camRoll) {
        this.camRoll = camRoll;
        return this;
    }

    public AnimationProperties withCamY(float camY) {
        this.camY = camY;
        return this;
    }

    public AnimationProperties withJumpModifier(float jumpModifier) {
        this.jumpModifier = jumpModifier;
        return this;
    }

    public AnimationProperties withHeightModifier(float heightModifier) {
        this.heightModifier = heightModifier;
        return this;
    }

    public AnimationProperties withAnimationName(String animationName) {
        this.animationName = animationName;
        return this;
    }

    public AnimationProperties withAnimation(KeyframeAnimation animation) {
        this.animation = animation;
        return this;
    }

    public AnimationProperties withSwapRotation(boolean swapRotation) {
        this.swapRotation = swapRotation;
        return this;
    }

    public AnimationProperties withInvertX(boolean invertX) {
        this.invertX = invertX;
        return this;
    }

    public AnimationProperties withInvertY(boolean invertY) {
        this.invertY = invertY;
        return this;
    }

    public AnimationProperties withInvertView(boolean invertView) {
        this.invertView = invertView;
        return this;
    }

    public AnimationProperties copyOf(AnimationProperties properties) {
        this.camYaw = properties.camYaw;
        this.camPitch = properties.camPitch;
        this.camRoll = properties.camRoll;
        this.camY = properties.camY;
        this.jumpModifier = properties.jumpModifier;
        this.heightModifier = properties.heightModifier;
        this.swapRotation = properties.swapRotation;
        this.invertX = properties.invertX;
        this.invertY = properties.invertY;
        this.invertView = properties.invertView;
        return this;
    }

    public void setAdjacent(Integer up, Integer down, Integer left, Integer right, Integer forward, Integer back) {
        this.up = up;
        this.down = down;
        this.left = left;
        this.right = right;
        this.forward = forward;
        this.back = back;
    }

    public void copyAdjacent(AnimationProperties properties) {
        this.up = properties.up;
        this.down = properties.down;
        this.left = properties.left;
        this.right = properties.right;
        this.forward = properties.forward;
        this.back = properties.back;
    }

    public int getLayerLevel() {
        return this.layerLevel;
    }

    public int getAnimationIndex() {
        return this.animationIndex;
    }

    public float getCamYaw() {
        return this.camYaw;
    }

    public float getCamPitch() {
        return this.camPitch;
    }

    public float getCamRoll() {
        return this.camRoll;
    }

    public float getCamY() {
        return this.camY;
    }

    public float getJumpModifier() {
        return this.jumpModifier;
    }

    public float getHeightModifier() {
        return this.heightModifier;
    }

    public String getAnimationName() {
        return this.animationName;
    }

    public KeyframeAnimation getAnimation() {
        return this.animation;
    }

    public Integer getBack() {
        return this.back;
    }

    public Integer getForward() {
        return this.forward;
    }

    public Integer getRight() {
        return this.right;
    }

    public Integer getLeft() {
        return this.left;
    }

    public Integer getDown() {
        return this.down;
    }

    public Integer getUp() {
        return this.up;
    }

    public boolean isSwapRotation() {
        return this.swapRotation;
    }

    public boolean isInvertX() {
        return this.invertX;
    }

    public boolean isInvertY() {
        return this.invertY;
    }

    public boolean isInvertView() {
        return this.invertView;
    }
}
