package p.studio.workspaces.assets.metadata;

import java.util.Locale;

public enum AssetStudioGlyphSpecialization {
    NONE("none"),
    TILESET("tileset"),
    SPRITES("sprites"),
    UI("ui");

    private final String manifestValue;

    AssetStudioGlyphSpecialization(String manifestValue) {
        this.manifestValue = manifestValue;
    }

    public String manifestValue() {
        return manifestValue;
    }

    public static AssetStudioGlyphSpecialization fromManifestValue(String value) {
        if (value == null) {
            return NONE;
        }
        final String normalized = value.trim().toLowerCase(Locale.ROOT);
        for (AssetStudioGlyphSpecialization candidate : values()) {
            if (candidate.manifestValue.equals(normalized)) {
                return candidate;
            }
        }
        return NONE;
    }
}
