diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 0000000..ffa0eb4
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,24 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 16
+ uses: actions/setup-java@v1
+ with:
+ java-version: 16
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..85e7c1d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/.idea/
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 26d3352..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index b67d6a5..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index 8dcf5b9..0000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
deleted file mode 100644
index 5a6f4b1..0000000
--- a/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 5f3e0f8..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
deleted file mode 100644
index e96534f..0000000
--- a/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/branch.iml b/core-tests/core-tests.iml
similarity index 100%
rename from branch.iml
rename to core-tests/core-tests.iml
diff --git a/core-tests/pom.xml b/core-tests/pom.xml
new file mode 100644
index 0000000..341cfa7
--- /dev/null
+++ b/core-tests/pom.xml
@@ -0,0 +1,75 @@
+
+
+
+
+ 4.0.0
+
+
+ branch
+ me.aurium
+ 0.1.0
+
+
+ branch-core-tests
+ 0.1.0
+
+
+ ${compiler.version}
+ ${compiler.version}
+
+
+
+
+ branch-core
+ me.aurium
+ 0.1.0
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.7.0
+ test
+
+
+ org.slf4j
+ slf4j-api
+ 2.0.0-alpha1
+ test
+
+
+ ch.qos.logback
+ logback-core
+ 1.3.0-alpha5
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ 1.2.3
+ test
+
+
+
+
+
\ No newline at end of file
diff --git a/core-tests/src/main/java/me/aurium/branch/tests/StringAdapter.java b/core-tests/src/main/java/me/aurium/branch/tests/StringAdapter.java
new file mode 100644
index 0000000..3795f71
--- /dev/null
+++ b/core-tests/src/main/java/me/aurium/branch/tests/StringAdapter.java
@@ -0,0 +1,27 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.tests;
+
+import me.aurium.branch.centralized.typeadapter.CommonAdapter;
+
+public class StringAdapter implements CommonAdapter {
+}
diff --git a/core-tests/src/main/java/me/aurium/branch/tests/StringManager.java b/core-tests/src/main/java/me/aurium/branch/tests/StringManager.java
new file mode 100644
index 0000000..229da42
--- /dev/null
+++ b/core-tests/src/main/java/me/aurium/branch/tests/StringManager.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.tests;
+
+import me.aurium.branch.centralized.*;
+import me.aurium.branch.centralized.base.NodeBase;
+import me.aurium.branch.centralized.base.NodeBaseBuilder;
+import me.aurium.branch.centralized.typeadapter.ManagerAdapter;
+
+public class StringManager implements CentralizedManager {
+
+ private final static StringAdapter defaultAdapter = new StringAdapter();
+
+ @Override
+ public CentralizedManagerBinder getBinder(Void platform) {
+ throw new IllegalStateException("StringManager is for tests!");
+ }
+
+ @Override
+ public NodeSource getSource() {
+ return null;
+ }
+
+ @Override
+ public NodeBaseBuilder newCommand() {
+ return new NodeBaseBuilder<>(this,defaultAdapter);
+ }
+
+ @Override
+ public NodeBaseBuilder newCommand(ManagerAdapter adapter) {
+ return new NodeBaseBuilder<>(this,adapter);
+ }
+
+ @Override
+ public void injectCommand(NodeBase base) {
+ throw new IllegalStateException("StringManager is for tests!");
+ }
+}
diff --git a/core-tests/src/test/java/me/aurium/branch/ExecutionTest.java b/core-tests/src/test/java/me/aurium/branch/ExecutionTest.java
new file mode 100644
index 0000000..5ebc147
--- /dev/null
+++ b/core-tests/src/test/java/me/aurium/branch/ExecutionTest.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch;
+
+import me.aurium.branch.tests.StringManager;
+import org.junit.platform.commons.logging.Logger;
+import org.junit.platform.commons.logging.LoggerFactory;
+
+public class ExecutionTest {
+
+ private final static Logger logger = LoggerFactory.getLogger(ExecutionTest.class);
+
+ private final StringManager manager = new StringManager();
+
+}
diff --git a/core/pom.xml b/core/pom.xml
index cede4cf..b7479b7 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1,4 +1,25 @@
+
+
@@ -9,19 +30,27 @@
4.0.0
- core
+ branch-core
${compiler.version}
${compiler.version}
-
-
- me.aurium
- beetle-core
- ${core.version}
-
-
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M5
+
+ false
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/src/main/java/me/aurium/beetle/branch/AlreadyStoredHashSet.java b/core/src/main/java/me/aurium/beetle/branch/AlreadyStoredHashSet.java
deleted file mode 100644
index e6f8771..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/AlreadyStoredHashSet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package me.aurium.beetle.branch;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Represents a set that already has an element in it
- */
-public class AlreadyStoredHashSet {
-
- private T alreadyStored;
- private final Set otherThingsInTheSet;
-
- //fuck code in the constructor rules
- //i don't care
- public AlreadyStoredHashSet(T alreadyStored) {
- this.alreadyStored = alreadyStored;
- this.otherThingsInTheSet = new HashSet<>();
- }
-
- public AlreadyStoredHashSet(Set set) {
- this.otherThingsInTheSet = set;
- }
-
- public AlreadyStoredHashSet() {
- this.otherThingsInTheSet = new HashSet<>();
- }
-
- /**
- * Returns an immutable collection of T (plus already stored variable if it is present)
- * @return an immutable collection of T
- */
- public Set getContents() {
- if (alreadyStored == null) {
- return Set.copyOf(otherThingsInTheSet);
- } else {
- Set set = new HashSet<>(otherThingsInTheSet);
-
- set.add(alreadyStored);
-
- return Set.copyOf(set);
- }
- }
-
- /**
- * get already store thing
- * @return already stored thing or null
- */
- public T getAlreadyStored() {
- return alreadyStored;
- }
-
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/CommandBase.java b/core/src/main/java/me/aurium/beetle/branch/CommandBase.java
deleted file mode 100644
index f72961e..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/CommandBase.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package me.aurium.beetle.branch;
-
-public interface CommandBase {
-
- ContextHandler getHandler(Context context);
- void handle(Context context);
-
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/CommandNode.java b/core/src/main/java/me/aurium/beetle/branch/CommandNode.java
deleted file mode 100644
index 0266dfe..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/CommandNode.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package me.aurium.beetle.branch;
-
-import me.aurium.beetle.api.nodes.Node;
-
-public interface CommandNode extends Node> {
-
- /**
- * Represents the context handler to be used if there are no args or args are incorrect
- * @return said contexthandler...
- */
- ContextHandler getContextHandler();
-
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/Context.java b/core/src/main/java/me/aurium/beetle/branch/Context.java
deleted file mode 100644
index 3d3ccf6..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/Context.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package me.aurium.beetle.branch;
-
-/**
- * The context of a command
- * @param the type of command source
- */
-public interface Context {
-
- T getSender();
- String getAlias();
- String[] getArgs();
-
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/ContextHandler.java b/core/src/main/java/me/aurium/beetle/branch/ContextHandler.java
deleted file mode 100644
index 25d2701..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/ContextHandler.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package me.aurium.beetle.branch;
-
-@FunctionalInterface
-public interface ContextHandler {
-
- void consume(Context consumed);
-
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/bases/CommandableBase.java b/core/src/main/java/me/aurium/beetle/branch/bases/CommandableBase.java
deleted file mode 100644
index ba9eb32..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/bases/CommandableBase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package me.aurium.beetle.branch.bases;
-
-import me.aurium.beetle.api.command.AbstractCommand;
-import me.aurium.beetle.branch.CommandBase;
-import me.aurium.beetle.branch.CommandNode;
-import me.aurium.beetle.branch.Context;
-import me.aurium.beetle.branch.ContextHandler;
-import me.aurium.beetle.branch.impl.CommonContext;
-
-public class CommandableBase implements CommandBase, AbstractCommand {
-
- private final String name;
- private final String permission;
- private final CommandNode node;
-
- public CommandableBase(String name, String permission, CommandNode node) {
- this.name = name;
- this.permission = permission;
- this.node = node;
- }
-
- @Override
- public ContextHandler getHandler(Context context) {
- return null;
- }
-
- @Override
- public void handle(Context context) {
-
- }
-
- @Override
- public String getName() {
- return null;
- }
-
- @Override
- public String getPermission() {
- return null;
- }
-
- @Override
- public boolean execute(T t, String alias, String[] strings) {
- Context context = new CommonContext<>(t,alias,strings);
-
- handle(context);
-
- return true;
- }
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/bases/SimpleBase.java b/core/src/main/java/me/aurium/beetle/branch/bases/SimpleBase.java
deleted file mode 100644
index 2e63830..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/bases/SimpleBase.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package me.aurium.beetle.branch.bases;
-
-import me.aurium.beetle.api.nodes.impl.StringBlockPath;
-import me.aurium.beetle.api.nodes.path.BlockPath;
-import me.aurium.beetle.branch.CommandBase;
-import me.aurium.beetle.branch.CommandNode;
-import me.aurium.beetle.branch.Context;
-import me.aurium.beetle.branch.ContextHandler;
-
-import java.util.Optional;
-
-/// FIXME: 3/10/21 I've discovered that a nodemap cannot be built with both it's parent and contents being set up correctly
-public class SimpleBase implements CommandBase {
-
- private final CommandNode baseNode;
-
- public SimpleBase(CommandNode baseNode) {
- this.baseNode = baseNode;
- }
-
- @Override
- public ContextHandler getHandler(Context context) {
- BlockPath correctPath = StringBlockPath.of(context.getArgs());
- Optional> node = baseNode.getSpecificNode(correctPath);
-
- if (node.isPresent()) {
- return node.get().getContextHandler();
- } else {
- return baseNode.getContextHandler();
- }
- }
-
- @Override
- public void handle(Context context) {
- getHandler(context).consume(context);
- }
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/impl/CommonContext.java b/core/src/main/java/me/aurium/beetle/branch/impl/CommonContext.java
deleted file mode 100644
index ad88be8..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/impl/CommonContext.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package me.aurium.beetle.branch.impl;
-
-import me.aurium.beetle.branch.Context;
-
-public class CommonContext implements Context {
-
- private final T sender;
- private final String alias;
- private final String[] args;
-
- public CommonContext(T sender, String alias, String[] args) {
- this.sender = sender;
- this.alias = alias;
- this.args = args;
- }
-
- @Override
- public T getSender() {
- return sender;
- }
-
- @Override
- public String getAlias() {
- return alias;
- }
-
- @Override
- public String[] getArgs() {
- return args;
- }
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/nodes/BranchingCommandNode.java b/core/src/main/java/me/aurium/beetle/branch/nodes/BranchingCommandNode.java
deleted file mode 100644
index c0a5dbd..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/nodes/BranchingCommandNode.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package me.aurium.beetle.branch.nodes;
-
-import me.aurium.beetle.api.nodes.path.Block;
-import me.aurium.beetle.api.nodes.path.BlockPath;
-import me.aurium.beetle.branch.AlreadyStoredHashSet;
-import me.aurium.beetle.branch.CommandNode;
-import me.aurium.beetle.branch.ContextHandler;
-
-import java.util.Collection;
-import java.util.Optional;
-
-public class BranchingCommandNode implements CommandNode {
-
- private final AlreadyStoredHashSet> nodes;
- private final CommandNode root;
- private final CommandNode parent;
- private final Block path;
-
- public BranchingCommandNode(AlreadyStoredHashSet> nodes, CommandNode root, CommandNode parent, Block path, ContextHandler handler) {
- this.nodes = nodes;
- this.root = root;
- this.parent = parent;
- this.path = path;
- }
-
- @Override
- public BlockPath getAbsolutePath() {
- return parent.getAbsolutePath().resolve(path);
- }
-
- @Override
- public Block getShortPath() {
- return path;
- }
-
- @Override
- public CommandNode getRoot() {
- return root;
- }
-
- @Override
- public CommandNode getParent() {
- return parent;
- }
-
- @Override
- public Optional> getSpecificNode(BlockPath blockPath) {
- for (CommandNode node : this.getLinkedNodes()) {
- if (blockPath.startsWith(node.getShortPath())) {
- return node.getSpecificNode(blockPath);
- }
- }
- return Optional.empty();
- }
-
- @Override
- public Collection> getLinkedNodes() {
- return nodes.getContents();
- }
-
- @Override
- public ContextHandler getContextHandler() {
- return nodes.getAlreadyStored().getContextHandler();
- }
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/nodes/SingleCommandNode.java b/core/src/main/java/me/aurium/beetle/branch/nodes/SingleCommandNode.java
deleted file mode 100644
index bda8afb..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/nodes/SingleCommandNode.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package me.aurium.beetle.branch.nodes;
-
-import me.aurium.beetle.api.nodes.path.Block;
-import me.aurium.beetle.api.nodes.path.BlockPath;
-import me.aurium.beetle.branch.CommandNode;
-import me.aurium.beetle.branch.ContextHandler;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Optional;
-
-public class SingleCommandNode implements CommandNode {
-
- private final CommandNode root;
- private final CommandNode parent;
- private final Block identifier;
- private final ContextHandler handler;
-
- public SingleCommandNode(CommandNode root, CommandNode parent, Block identifier, ContextHandler contextHandler) {
- this.root = root;
- this.parent = parent;
- this.identifier = identifier;
- this.handler = contextHandler;
- }
-
- @Override
- public BlockPath getAbsolutePath() {
- return parent.getAbsolutePath().resolve(identifier);
- }
-
- @Override
- public Block getShortPath() {
- return identifier;
- }
-
- @Override
- public CommandNode getRoot() {
- return root;
- }
-
- @Override
- public CommandNode getParent() {
- return parent;
- }
-
- @Override
- public Optional> getSpecificNode(BlockPath blockPath) {
- return Optional.of(this);
- }
-
- @Override
- public Collection> getLinkedNodes() {
- return Collections.emptySet();
- }
-
- @Override
- public ContextHandler getContextHandler() {
- return handler;
- }
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/nodes/ValueNode.java b/core/src/main/java/me/aurium/beetle/branch/nodes/ValueNode.java
deleted file mode 100644
index db460b9..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/nodes/ValueNode.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package me.aurium.beetle.branch.nodes;
-
-public class ValueNode {
-}
diff --git a/core/src/main/java/me/aurium/beetle/branch/nodes/ValueSelectorNode.java b/core/src/main/java/me/aurium/beetle/branch/nodes/ValueSelectorNode.java
deleted file mode 100644
index 8b5cf78..0000000
--- a/core/src/main/java/me/aurium/beetle/branch/nodes/ValueSelectorNode.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package me.aurium.beetle.branch.nodes;
-
-public class ValueSelectorNode {
-}
diff --git a/core/src/main/java/me/aurium/branch/centralized/CentralizedManager.java b/core/src/main/java/me/aurium/branch/centralized/CentralizedManager.java
new file mode 100644
index 0000000..cac406a
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/CentralizedManager.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.centralized;
+
+import me.aurium.branch.centralized.base.NodeBase;
+import me.aurium.branch.centralized.base.NodeBaseBuilder;
+import me.aurium.branch.centralized.typeadapter.ManagerAdapter;
+
+/**
+ * Represents the utmost base part of the command framework which has the ability to bind any injected commands to a platform
+ * @param the input type, does not need to be of same type as the node bases it utilizes
+ * @param the platform
+ */
+public interface CentralizedManager {
+
+ CentralizedManagerBinder getBinder(V platform);
+ NodeSource getSource();
+
+ NodeBaseBuilder newCommand();
+ NodeBaseBuilder newCommand(ManagerAdapter adapter);
+
+ void injectCommand(NodeBase base);
+
+
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/CentralizedManagerBinder.java b/core/src/main/java/me/aurium/branch/centralized/CentralizedManagerBinder.java
new file mode 100644
index 0000000..2c16ed7
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/CentralizedManagerBinder.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.centralized;
+
+/**
+ * Represents a carrier vessel which is typically attached to the instance of a centralizedManagerBinder's platform
+ */
+public interface CentralizedManagerBinder {
+
+ /**
+ * Register all commands to the platform
+ */
+ void bind();
+
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/NodeSource.java b/core/src/main/java/me/aurium/branch/centralized/NodeSource.java
new file mode 100644
index 0000000..e7867be
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/NodeSource.java
@@ -0,0 +1,14 @@
+package me.aurium.branch.centralized;
+
+import me.aurium.branch.nodes.branching.ExclusiveBranchingBuilder;
+import me.aurium.branch.nodes.branching.InclusiveBranchingBuilder;
+import me.aurium.branch.nodes.single.SingleBuilder;
+
+public interface NodeSource {
+
+ SingleBuilder single();
+ InclusiveBranchingBuilder inclusiveBranching();
+ ExclusiveBranchingBuilder exclusiveBranching();
+ //TODO help and argument
+
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/base/AdaptingNodeBase.java b/core/src/main/java/me/aurium/branch/centralized/base/AdaptingNodeBase.java
new file mode 100644
index 0000000..4f0e0c9
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/base/AdaptingNodeBase.java
@@ -0,0 +1,86 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.centralized.base;
+
+import me.aurium.branch.centralized.typeadapter.ManagerAdapter;
+import me.aurium.branch.execution.api.Execution;
+import me.aurium.branch.execution.ContextProvider;
+import me.aurium.branch.execution.NodeContext;
+import me.aurium.branch.fallback.strategies.FallbackSearchStrategy;
+import me.aurium.branch.information.description.Description;
+import me.aurium.branch.interfacing.handlers.InterfacingHandler;
+import me.aurium.branch.nodes.CommandNode;
+import me.aurium.branch.nodes.results.SearchInfo;
+import me.aurium.branch.nodes.results.model.Result;
+
+import java.util.List;
+
+/**
+ * Represents a node base that has the ability to convert it's input sender to a sender of type C or fail with a result.
+ * @param the input type of nodebase
+ * @param the adapted adjusted type desired, based on a similar adapter.
+ */
+public abstract class AdaptingNodeBase implements NodeBase {
+
+ private final ManagerAdapter adapter;
+
+ private final CommandNode baseNode;
+ private final FallbackSearchStrategy strategy;
+ private final ContextProvider provider;
+ private final InterfacingHandler handler;
+
+ public AdaptingNodeBase(ManagerAdapter adapter, CommandNode baseNode, FallbackSearchStrategy strategy, ContextProvider provider, InterfacingHandler handler) {
+ this.adapter = adapter;
+ this.baseNode = baseNode;
+ this.strategy = strategy;
+ this.provider = provider;
+ this.handler = handler;
+ }
+
+ public void execute(T t, String alias, String[] args) {
+ if (!adapter.canAdapt(t)) {
+ handler.sendMessage(t,adapter.failedParseResponse(t));
+ return;
+ }
+
+ C adaptedSender = adapter.adapt(t);
+
+ Result> result = strategy.attemptPreprocess(adaptedSender,alias,args,baseNode);
+
+ if (!result.isSuccessful()) {
+ handler.sendMessage(t, result.getFailure());
+ return;
+ }
+
+ SearchInfo info = result.getSuccess();
+ NodeContext produced = provider.produce(adaptedSender,alias,args,baseNode,info);
+
+ Execution execution = info.resultingNode().getHandling().getExecution(produced);
+
+ execution.run();
+ }
+
+ public List suggest(T t, String alias, String[] args) {
+ return null; //TODO
+ }
+
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/base/DelegatingNodeBase.java b/core/src/main/java/me/aurium/branch/centralized/base/DelegatingNodeBase.java
new file mode 100644
index 0000000..cddf7e0
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/base/DelegatingNodeBase.java
@@ -0,0 +1,35 @@
+package me.aurium.branch.centralized.base;
+
+import me.aurium.branch.centralized.typeadapter.ManagerAdapter;
+import me.aurium.branch.execution.ContextProvider;
+import me.aurium.branch.fallback.strategies.FallbackSearchStrategy;
+import me.aurium.branch.information.description.Description;
+import me.aurium.branch.interfacing.handlers.InterfacingHandler;
+import me.aurium.branch.nodes.CommandNode;
+import me.aurium.branch.nodes.IdentifiableNode;
+
+/**
+ * Adapting node base that delegates identifier calls to the first node in the base stack.
+ * @param t
+ * @param c
+ */
+public class DelegatingNodeBase extends AdaptingNodeBase {
+
+ private final IdentifiableNode baseNode;
+
+ public DelegatingNodeBase(ManagerAdapter adapter, IdentifiableNode baseNode, FallbackSearchStrategy strategy, ContextProvider provider, InterfacingHandler handler) {
+ super(adapter, baseNode, strategy, provider, handler);
+
+ this.baseNode = baseNode;
+ }
+
+ @Override
+ public Description getDescription() {
+ return baseNode.getDescription();
+ }
+
+ @Override
+ public String getIdentifier() {
+ return baseNode.getIdentifier().getIdentifier();
+ }
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/base/NodeBase.java b/core/src/main/java/me/aurium/branch/centralized/base/NodeBase.java
new file mode 100644
index 0000000..4323616
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/base/NodeBase.java
@@ -0,0 +1,45 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.centralized.base;
+
+import me.aurium.branch.information.description.Description;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Represents a single command tree as a command
+ * @param type of input sender
+ */
+public interface NodeBase {
+
+ void execute(T t, String alias, String[] args); //may execute instantly or take some time
+ List suggest(T t, String alias, String[] args);
+
+ Description getDescription();
+ String getIdentifier();
+
+ default List getAliases() {
+ return Collections.emptyList();
+ }
+
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/base/NodeBaseBuilder.java b/core/src/main/java/me/aurium/branch/centralized/base/NodeBaseBuilder.java
new file mode 100644
index 0000000..42154c0
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/base/NodeBaseBuilder.java
@@ -0,0 +1,96 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.centralized.base;
+
+import me.aurium.branch.centralized.CentralizedManager;
+import me.aurium.branch.centralized.typeadapter.ManagerAdapter;
+import me.aurium.branch.execution.ContextProvider;
+import me.aurium.branch.fallback.strategies.FallbackSearchStrategy;
+import me.aurium.branch.interfacing.handlers.InterfacingHandler;
+import me.aurium.branch.nodes.CommandNode;
+import me.aurium.branch.nodes.IdentifiableNode;
+
+import java.util.Objects;
+
+/**
+ * Default implementation of a class that produces adaptingNodeBases
+ *
+ * @param Input type
+ * @param Adapted type
+ */
+public class NodeBaseBuilder {
+
+ private final CentralizedManager manager;
+ private final ManagerAdapter adapter;
+
+ private IdentifiableNode node;
+ private FallbackSearchStrategy strategy;
+ private ContextProvider provider;
+ private InterfacingHandler handler;
+
+
+ public NodeBaseBuilder(CentralizedManager manager, ManagerAdapter adapter) {
+ this.manager = manager;
+ this.adapter = adapter;
+ }
+
+ public NodeBaseBuilder(CentralizedManager manager, ManagerAdapter adapter, FallbackSearchStrategy strategy, ContextProvider provider, InterfacingHandler handler) {
+ this.manager = manager;
+ this.adapter = adapter;
+ this.strategy = strategy;
+ this.provider = provider;
+ this.handler = handler;
+ }
+
+ public NodeBaseBuilder setNode(IdentifiableNode node) {
+ this.node = node;
+
+ return this;
+ }
+
+ public NodeBaseBuilder setStrategy(FallbackSearchStrategy strategy) {
+ this.strategy = strategy;
+
+ return this;
+ }
+
+ public NodeBaseBuilder setProvider(ContextProvider provider) {
+ this.provider = provider;
+
+ return this;
+ }
+
+ public NodeBaseBuilder setHandler(InterfacingHandler handler) {
+ this.handler = handler;
+
+ return this;
+ }
+
+ public void inject() {
+ Objects.requireNonNull(node);
+ Objects.requireNonNull(strategy);
+ Objects.requireNonNull(provider);
+ Objects.requireNonNull(handler);
+
+ manager.injectCommand(new DelegatingNodeBase<>(adapter,node,strategy,provider,handler));
+ }
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/typeadapter/CommonAdapter.java b/core/src/main/java/me/aurium/branch/centralized/typeadapter/CommonAdapter.java
new file mode 100644
index 0000000..fb18fcd
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/typeadapter/CommonAdapter.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.centralized.typeadapter;
+
+import me.aurium.branch.interfacing.responses.FailedAdaptingResponse;
+
+/**
+ * Represents an adapter that does not convert and simply returns the same object
+ * @param the object type
+ */
+public interface CommonAdapter extends ManagerAdapter {
+
+ @Override
+ default T adapt(T input) {
+ return input;
+ }
+
+ @Override
+ default boolean canAdapt(T input) {
+ return true;
+ }
+
+ @Override
+ default FailedAdaptingResponse failedParseResponse(T input) {
+ throw new IllegalStateException("How did you get here (Since canAdapt is always true this should never occur?)");
+ }
+}
diff --git a/core/src/main/java/me/aurium/branch/centralized/typeadapter/ManagerAdapter.java b/core/src/main/java/me/aurium/branch/centralized/typeadapter/ManagerAdapter.java
new file mode 100644
index 0000000..56e51f9
--- /dev/null
+++ b/core/src/main/java/me/aurium/branch/centralized/typeadapter/ManagerAdapter.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * Branch
+ * Copyright © 2021 Aurium
+ *
+ * Branch is free software: you can redistribute it and/or modify
+ * It under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Branch is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Branch. If not, see
+ * and navigate to version 3 of the GNU Affero General Public License.
+ *
+ */
+
+package me.aurium.branch.centralized.typeadapter;
+
+import me.aurium.branch.interfacing.responses.FailedAdaptingResponse;
+
+/**
+ * Represents something that can convert an object of a certain type to another object
+ * It is used to enable the use of nodes of a unique type on a centralized manager of a separate type.
+ *
+ * @param Input object type
+ * @param