Compare commits
No commits in common. "d0cbb096a85e605d23393377d970e1c2842fc784" and "3e50a065a3cf6eb5cfaa05ddd7689d362bf9059b" have entirely different histories.
d0cbb096a8
...
3e50a065a3
@ -20,6 +20,12 @@ dependencies {
|
||||
testImplementation(libs.junit.jupiter)
|
||||
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
|
||||
// This dependency is exported to consumers, that is to say found on their compile classpath.
|
||||
api(libs.commons.math3)
|
||||
|
||||
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
|
||||
implementation(libs.guava)
|
||||
implementation(libs.log4j)
|
||||
|
||||
}
|
||||
|
@ -1,24 +1,13 @@
|
||||
package net.tomatentum.marinara;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
import net.tomatentum.marinara.registry.InteractionRegistry;
|
||||
import net.tomatentum.marinara.wrapper.LibraryWrapper;
|
||||
|
||||
public class Marinara {
|
||||
|
||||
public static <T extends LibraryWrapper> Marinara load(Class<T> clazz) {
|
||||
try {
|
||||
Constructor<T> ctor = clazz.getConstructor();
|
||||
ctor.setAccessible(true);
|
||||
T wrapper = ctor.newInstance();
|
||||
InteractionRegistry registry = new InteractionRegistry(wrapper);
|
||||
return new Marinara(registry);
|
||||
}catch (Exception ex) {
|
||||
System.err.println(ex);
|
||||
System.exit(100);
|
||||
return null;
|
||||
}
|
||||
public static Marinara load(LibraryWrapper wrapper) {
|
||||
InteractionRegistry registry = new InteractionRegistry(wrapper);
|
||||
return new Marinara(registry);
|
||||
}
|
||||
|
||||
private InteractionRegistry registry;
|
||||
|
@ -0,0 +1,4 @@
|
||||
package net.tomatentum.marinara.handler;
|
||||
|
||||
public interface InteractionHandler {
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package net.tomatentum.marinara.interaction;
|
||||
|
||||
public interface InteractionHandler {
|
||||
}
|
@ -2,13 +2,13 @@ package net.tomatentum.marinara.interaction.methods;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.tomatentum.marinara.interaction.InteractionHandler;
|
||||
import net.tomatentum.marinara.interaction.InteractionType;
|
||||
import net.tomatentum.marinara.interaction.commands.ExecutableCommandDefinition;
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.ApplicationCommand;
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.SubCommand;
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.SubCommandGroup;
|
||||
import net.tomatentum.marinara.util.ReflectionUtil;
|
||||
import net.tomatentum.marinara.handler.InteractionHandler;
|
||||
import net.tomatentum.marinara.wrapper.LibraryWrapper;
|
||||
|
||||
public class CommandInteractionMethod extends InteractionMethod {
|
||||
|
@ -6,7 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.tomatentum.marinara.interaction.InteractionHandler;
|
||||
import net.tomatentum.marinara.handler.InteractionHandler;
|
||||
import net.tomatentum.marinara.interaction.InteractionType;
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.ApplicationCommand;
|
||||
import net.tomatentum.marinara.interaction.commands.annotation.SubCommand;
|
||||
|
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.tomatentum.marinara.interaction.InteractionHandler;
|
||||
import net.tomatentum.marinara.handler.InteractionHandler;
|
||||
import net.tomatentum.marinara.interaction.InteractionType;
|
||||
import net.tomatentum.marinara.interaction.commands.ApplicationCommandDefinition;
|
||||
import net.tomatentum.marinara.interaction.commands.ExecutableCommandDefinition;
|
||||
|
Loading…
x
Reference in New Issue
Block a user