2019-08-26 09:43:53 +03:00
|
|
|
package pro.gravit.launcher.modules;
|
|
|
|
|
|
|
|
import pro.gravit.utils.Version;
|
|
|
|
|
2019-08-26 12:27:30 +03:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.nio.file.Path;
|
2019-08-26 09:43:53 +03:00
|
|
|
import java.util.function.Predicate;
|
|
|
|
|
|
|
|
public interface LauncherModulesManager {
|
|
|
|
LauncherModule loadModule(LauncherModule module);
|
2019-08-26 12:27:30 +03:00
|
|
|
LauncherModule loadModule(Path file) throws IOException;
|
2019-08-26 09:43:53 +03:00
|
|
|
LauncherModule getModule(String name);
|
2019-08-26 12:27:30 +03:00
|
|
|
LauncherModule getCoreModule();
|
2019-08-26 09:43:53 +03:00
|
|
|
default boolean containsModule(String name)
|
|
|
|
{
|
|
|
|
return getModule(name) != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
default <T extends LauncherModule> boolean containsModule(Class<? extends T> clazz)
|
|
|
|
{
|
|
|
|
return getModule(clazz) != null;
|
|
|
|
}
|
|
|
|
ClassLoader getModuleClassLoader();
|
|
|
|
<T extends LauncherModule> T getModule(Class<? extends T> clazz);
|
|
|
|
<T extends LauncherModule> T findModule(Class<? extends T> clazz, Predicate<Version> versionPredicate);
|
2019-08-26 10:42:49 +03:00
|
|
|
<T extends LauncherModule.Event> void invokeEvent(T event) throws Exception;
|
2019-08-26 09:43:53 +03:00
|
|
|
}
|