package p.studio.workspaces.assets.metadata;

public record AssetStudioSceneTile(
        boolean active,
        int glyphId,
        int paletteId,
        boolean flipX,
        boolean flipY) {

    public AssetStudioSceneTile {
        if (glyphId < 0) {
            throw new IllegalArgumentException("glyphId must be non-negative");
        }
        if (paletteId < 0) {
            throw new IllegalArgumentException("paletteId must be non-negative");
        }
    }

    public static AssetStudioSceneTile inactive(int paletteId) {
        return new AssetStudioSceneTile(false, 0, Math.max(0, paletteId), false, false);
    }
}
