/*
 * Decompiled with CFR 0.152.
 */
package com.evilco.mc.nbt.tag;

import com.evilco.mc.nbt.tag.ITag;
import com.evilco.mc.nbt.tag.TagByte;
import com.evilco.mc.nbt.tag.TagByteArray;
import com.evilco.mc.nbt.tag.TagCompound;
import com.evilco.mc.nbt.tag.TagDouble;
import com.evilco.mc.nbt.tag.TagFloat;
import com.evilco.mc.nbt.tag.TagInteger;
import com.evilco.mc.nbt.tag.TagIntegerArray;
import com.evilco.mc.nbt.tag.TagList;
import com.evilco.mc.nbt.tag.TagLong;
import com.evilco.mc.nbt.tag.TagShort;
import com.evilco.mc.nbt.tag.TagString;
import com.google.common.collect.ImmutableMap;
import java.util.Map;

public enum TagType {
    BYTE(1, TagByte.class),
    BYTE_ARRAY(7, TagByteArray.class),
    COMPOUND(10, TagCompound.class),
    DOUBLE(6, TagDouble.class),
    END(0, null),
    FLOAT(5, TagFloat.class),
    INTEGER(3, TagInteger.class),
    INTEGER_ARRAY(11, TagIntegerArray.class),
    LIST(9, TagList.class),
    LONG(4, TagLong.class),
    SHORT(2, TagShort.class),
    STRING(8, TagString.class);

    protected static final Map<Byte, TagType> typeMap;
    public final Class<? extends ITag> tagType;
    public final byte typeID;

    private TagType(int typeID, Class<? extends ITag> type) {
        this.typeID = (byte)typeID;
        this.tagType = type;
    }

    public static TagType valueOf(byte typeID) {
        return typeMap.get(typeID);
    }

    static {
        ImmutableMap.Builder<Byte, TagType> mapBuilder = new ImmutableMap.Builder<Byte, TagType>();
        for (TagType type : TagType.values()) {
            mapBuilder.put(type.typeID, type);
        }
        typeMap = mapBuilder.build();
    }
}
