From bfc4753e6674cc74485e2433f80214f3ff21b70b Mon Sep 17 00:00:00 2001 From: zaaarf Date: Tue, 22 Aug 2023 11:09:27 +0200 Subject: [PATCH] chore: separated processor and api --- README.md | 2 +- .../geb/api/annotations/BusInstance.java | 17 ---------- .../java/ftbsc/geb/api/annotations/Event.java | 17 ---------- .../ftbsc/geb/api/annotations/Listen.java | 32 ------------------- .../geb/api/annotations/ListenerInstance.java | 17 ---------- 5 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 src/main/java/ftbsc/geb/api/annotations/BusInstance.java delete mode 100644 src/main/java/ftbsc/geb/api/annotations/Event.java delete mode 100644 src/main/java/ftbsc/geb/api/annotations/Listen.java delete mode 100644 src/main/java/ftbsc/geb/api/annotations/ListenerInstance.java diff --git a/README.md b/README.md index 267ed9c..5461cf6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Suppose that you have a simple event system, with annotated listeners receiving That works, of course, but it's not that fast. Ah, if only you knew in advance, such as at compile time, who's going to get called with what... oh, wait, you do. -GEB is just a basic event bus in itself; the actual magician is the processor, who writes into each event direct calls to all subscribers, to take as little time as possible. +GEB is just a basic event bus in itself; the actual magician is the [processor](https://github.com/zaaarf/geb-processor), who writes into each event direct calls to all subscribers, to take as little time as possible. ## What's with the name? "GEB Bus" kind of sounds like "Jeb Bush" and I think it's very funny. Please clap. \ No newline at end of file diff --git a/src/main/java/ftbsc/geb/api/annotations/BusInstance.java b/src/main/java/ftbsc/geb/api/annotations/BusInstance.java deleted file mode 100644 index cacab39..0000000 --- a/src/main/java/ftbsc/geb/api/annotations/BusInstance.java +++ /dev/null @@ -1,17 +0,0 @@ -package ftbsc.geb.api.annotations; - -import ftbsc.geb.api.IBus; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * This annotation should mark either a static instance of {@link IBus} - * or a static method returning one. - * @since 0.1.0 - */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.CLASS) -public @interface BusInstance {} diff --git a/src/main/java/ftbsc/geb/api/annotations/Event.java b/src/main/java/ftbsc/geb/api/annotations/Event.java deleted file mode 100644 index ea1724c..0000000 --- a/src/main/java/ftbsc/geb/api/annotations/Event.java +++ /dev/null @@ -1,17 +0,0 @@ -package ftbsc.geb.api.annotations; - -import ftbsc.geb.api.IEvent; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks a class as an Event. It should implement the {@link IEvent} interface. - * It doesn't need to be abstract, but it can never be final. - * @since 0.1.0 - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.CLASS) -public @interface Event {} diff --git a/src/main/java/ftbsc/geb/api/annotations/Listen.java b/src/main/java/ftbsc/geb/api/annotations/Listen.java deleted file mode 100644 index 216937a..0000000 --- a/src/main/java/ftbsc/geb/api/annotations/Listen.java +++ /dev/null @@ -1,32 +0,0 @@ -package ftbsc.geb.api.annotations; - -import ftbsc.geb.api.IEvent; -import ftbsc.geb.api.IListener; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks the method as a listener. Its parent must implement the {@link IListener} interface. - * The annotated method should only take a single input value, an instance of {@link IEvent}; - * it should be either void or boolean; if it's boolean, the return value indicates whether - * the event was canceled. - * @since 0.1.0 - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.CLASS) -public @interface Listen { - /** - * @return an integer indicating priority level for the listener, defaulting to 0 - */ - int priority() default 0; - - /** - * @return an array of {@link String}s specifying which buses they should be listening on; - * an empty array means that they should listen on all buses, ignoring identifiers: - * that's probably what you wanted anyway. - */ - String[] on() default {}; //empty array = listen on all of them -} diff --git a/src/main/java/ftbsc/geb/api/annotations/ListenerInstance.java b/src/main/java/ftbsc/geb/api/annotations/ListenerInstance.java deleted file mode 100644 index c386592..0000000 --- a/src/main/java/ftbsc/geb/api/annotations/ListenerInstance.java +++ /dev/null @@ -1,17 +0,0 @@ -package ftbsc.geb.api.annotations; - -import ftbsc.geb.api.IListener; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * This annotation should mark either be a static instance of {@link IListener} - * or a static method returning one. - * @since 0.1.0 - */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.CLASS) -public @interface ListenerInstance {}