package top.r3944realms.lib39.core.compat;

import net.minecraft.resources.Identifier;

import java.util.Map;
import java.util.Optional;

/**
 * The interface Compat manager.
 *
 * @param <C> the type parameter
 */
public interface ICompatManager<C extends ICompat> {
    /**
     * Gets id.
     *
     * @return the id
     */
    Identifier getId();

    /**
     * Gets compat map.
     *
     * @return the compat map
     */
    Map<Identifier, C> getCompatMap();

    /**
     * Initialize.
     */
    void initialize();

    /**
     * Register compat.
     *
     * @param id     the id
     * @param compat the compat
     */
    void registerCompat(Identifier id, C compat);

    /**
     * Register compat.
     *
     * @param namespace the namespace
     * @param path      the path
     * @param compat    the compat
     */
    void registerCompat(String namespace, String path, C compat);

    /**
     * Gets compat.
     *
     * @param id the id
     * @return the compat
     */
    Optional<C> getCompat(Identifier id);

    /**
     * Has compat boolean.
     *
     * @param id the id
     * @return the boolean
     */
    boolean hasCompat(Identifier id);

    /**
     * Unregister compat.
     *
     * @param id the id
     */
    void unregisterCompat(Identifier id);
}
