package shadersmod.client;

import net.minecraft.client.renderer.vertex.VertexFormatElement;

public enum SVertexElementUsage
{
    POSITION(VertexFormatElement.EnumUsage.POSITION),
    NORMAL(VertexFormatElement.EnumUsage.NORMAL),
    COLOR(VertexFormatElement.EnumUsage.COLOR),
    UV(VertexFormatElement.EnumUsage.UV),
    MATRIX(VertexFormatElement.EnumUsage.MATRIX),
    BLEND_WEIGHT(VertexFormatElement.EnumUsage.BLEND_WEIGHT),
    PADDING(VertexFormatElement.EnumUsage.PADDING),
	MIDUV("Mid UV"),
	TANGENT("Tangent"),
	ENTITY("Entity");
	
    private final String displayName;
    private final VertexFormatElement.EnumUsage usage;

    private SVertexElementUsage(VertexFormatElement.EnumUsage vUsageIn)
    {
        this.displayName = vUsageIn.getDisplayName();
        this.usage = vUsageIn;
    }
    
    private SVertexElementUsage(String displayNameIn)
    {
        this.displayName = displayNameIn;
        this.usage = VertexFormatElement.EnumUsage.PADDING;
    }
    
    public String getDisplayName()
    {
        return this.displayName;
    }
    
    public VertexFormatElement.EnumUsage getUsage()
    {
        return this.usage;
    }

    public static SVertexElementUsage toSVEUsage(VertexFormatElement.EnumUsage usage) {
		switch (usage) {
		case POSITION    : return SVertexElementUsage.POSITION;
		case NORMAL      : return SVertexElementUsage.NORMAL;
		case COLOR       : return SVertexElementUsage.COLOR;
		case UV          : return SVertexElementUsage.UV;
		case MATRIX      : return SVertexElementUsage.MATRIX;
		case BLEND_WEIGHT: return SVertexElementUsage.BLEND_WEIGHT;
		case PADDING     : return SVertexElementUsage.PADDING;
		default          : return null;
		}
    }
}