package common.model;

public enum Transforms {
    DEFAULT(
		Transform.IDENTITY, 
		Transform.IDENTITY, 
		Transform.IDENTITY, 
		Transform.IDENTITY
    ),
	ANVIL(
		transform(10.0f, -45.0f, 170.0f, 0.25f, 1.5f, -2.5f, 0.375f),
		Transform.IDENTITY,
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	BLOCK(
		transform(10.0f, -45.0f, 170.0f, 0.0f, 1.5f, -2.75f, 0.375f),
		Transform.IDENTITY,
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	ITEM(
		transform(-90.0f, 0.0f, 0.0f, 0.0f, 1.0f, -3.0f, 0.55f),
		transform(0.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	TOOL_FLIP(
		transform(180.0f, 90.0f, -35.0f, 0.0f, 0.0f, -3.5f, 0.85f),
		transform(0.0f, 45.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	TOOL(
		transform(0.0f, 90.0f, -35.0f, 0.0f, 1.25f, -3.5f, 0.85f),
		transform(0.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	OFFSET2(
		transform(-90.0f, 0.0f, 0.0f, 0.0f, 1.0f, -2.25f, 0.55f),
		transform(0.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	LAYER(
		transform(10.0f, -45.0f, 170.0f, 0.0f, 0.25f, -2.75f, 0.375f),
		transform(0.0f, 0.0f, 0.0f, 0.0f, 5.25f, 0.0f, 1.0f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	DICE(
		transform(10.0f, -45.0f, 170.0f, 0.0f, 1.5f, -1.75f, 0.15f),
		transform(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f),
		transform(135.0f, -55.0f, 180.0f, 0.0f, 0.0f, 0.0f, 1.1f),
		transform(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f)
	),
	STAIRS(
		transform(10.0f, -45.0f, 170.0f, 0.0f, 1.5f, -2.75f, 0.375f),
		Transform.IDENTITY,
		transform(0.0f, 180.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f),
		Transform.IDENTITY
	),
	OFFSET1(
		transform(-90.0f, 0.0f, 0.0f, 0.0f, 1.0f, -2.5f, 0.55f),
		transform(0.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	GATE(
		transform(0.0f, -90.0f, 170.0f, 0.0f, 1.5f, -2.75f, 0.375f),
		transform(0.0f, 90.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	NUGGET(
		transform(-90.0f, 0.0f, 0.0f, 0.0f, 1.0f, -2.0f, 0.55f),
		transform(0.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	SKULL(
		transform(180.0f, -45.0f, 0.0f, 0.0f, 1.0f, -2.5f, 0.25f),
		transform(0.0f, -180.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.55f),
		transform(0.0f, 180.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.7f),
		Transform.IDENTITY
	),
	BUTTON(
		transform(10.0f, -45.0f, 170.0f, 0.0f, 1.0f, -1.75f, 0.375f),
		Transform.IDENTITY,
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	RANGED(
		transform(5.0f, 80.0f, -45.0f, 0.75f, 0.0f, 0.25f, 1.0f),
		transform(0.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	BANNER(
		transform(0.0f, 90.0f, -90.0f, 0.0f, 0.0f, -4.0f, 0.5f),
		transform(0.0f, 225.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f),
		transform(0.0f, -65.0f, 0.0f, 0.0f, -3.0f, 0.0f, 0.85f),
		Transform.IDENTITY
	),
	FENCE(
		transform(0.0f, 0.0f, 180.0f, 0.0f, 1.5f, -2.75f, 0.375f),
		Transform.IDENTITY,
		transform(0.0f, 90.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f),
		Transform.IDENTITY
	),
	FLAT(
		transform(10.0f, -45.0f, 170.0f, 0.0f, 0.25f, -2.75f, 0.375f),
		transform(0.0f, 0.0f, 0.0f, 0.0f, 5.0f, 0.0f, 1.0f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	ROD(
		transform(0.0f, 90.0f, -35.0f, 0.0f, 0.75f, -3.5f, 0.85f),
		transform(0.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	),
	KEY(
		transform(0.0f, 270.0f, -35.0f, 0.0f, 1.25f, -3.5f, 0.85f),
		transform(180.0f, -135.0f, 25.0f, 0.0f, 4.0f, 2.0f, 1.7f),
		Transform.IDENTITY,
		Transform.IDENTITY
	);

    public static enum Camera {
        NONE,
        THIRD_PERSON,
        FIRST_PERSON,
        GUI,
        GROUND;
    }
    
    private static Transform transform(float rx, float ry, float rz, float tx, float ty, float tz, float scale) {
    	return new Transform(rx, ry, rz, tx * 0.0625f, ty * 0.0625f, tz * 0.0625f, scale);
    }

	public final Transform third;
    public final Transform first;
    public final Transform gui;
    public final Transform ground;

	private Transforms(Transform third, Transform first, Transform gui, Transform ground) {
		this.third = third;
		this.first = first;
		this.gui = gui;
		this.ground = ground;
	}

	public Transform get(Camera type) {
		switch(type) {
			case THIRD_PERSON:
				return this.third;
			case FIRST_PERSON:
				return this.first;
			case GUI:
				return this.gui;
			case GROUND:
				return this.ground;
			default:
				return Transform.IDENTITY;
		}
	}
}
