001package net.tnemc.plugincore.core.component;
002/*
003 * The New Plugin Core
004 * Copyright (C) 2022 - 2025 Daniel "creatorfromhell" Vidmar
005 *
006 * This program is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Affero General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Affero General Public License for more details.
015 *
016 * You should have received a copy of the GNU Affero General Public License
017 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018 */
019
020import net.tnemc.plugincore.core.Platform;
021
022/**
023 * Component
024 *
025 * @author creatorfromhell
026 * @since 1.0.0.2
027 */
028public interface Component {
029
030  /**
031   * Returns the identifier associated with this Component.
032   *
033   * @return the identifier string
034   */
035  String identifier();
036
037  /**
038   * Checks if this method supports the given platform and version.
039   *
040   * @param platform the Platform to check for support
041   * @param version  the version string to check for support
042   *
043   * @return true if the platform and version are supported, false otherwise
044   */
045  boolean supports(final Platform platform, final String version);
046
047  /**
048   * Retrieves the array of dependencies required by this component.
049   *
050   * @return an array of strings representing the dependencies needed for this component
051   */
052  String[] dependencies();
053
054  /**
055   * Retrieves an array of library names that this Component requires.
056   *
057   * @return an array of strings representing the required libraries
058   */
059  String[] libraries();
060
061  /**
062   * Initializes the Component with the provided platform and version.
063   *
064   * @param platform the platform to initialize the Component for
065   * @param version  the Minecraft version string to initialize the Component with
066   */
067  void initialize(final Platform platform, final String version);
068
069  /**
070   * Initializes the registries for the given platform and version.
071   *
072   * @param platform the platform for which the registries are being initialized
073   * @param version  the Minecraft version of the platform
074   */
075  void initRegistries(final Platform platform, final String version);
076
077  /**
078   * Initializes the builders for the given platform and version.
079   *
080   * @param platform the platform to initialize the builders for
081   * @param version  the Minecraft version string to initialize the builders with
082   *
083   * @see ComponentBuilder
084   */
085  ComponentBuilder[] initBuilders(final Platform platform, final String version);
086}