diff --git a/README.md b/README.md index 0b51e44..52c7ce4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Event Bus +## Introduction + This library allows passing events between different objects without them having a direct reference to each other. Any class can be made an event by implementing the `IEvent` interface. @@ -10,6 +12,8 @@ To listen to events, register event handling methods using the `Event` annotatio For this to work, the method must have a return type of `void` and declare a single parameter of the desired event type. Additionally, the class containing the method must implement the `EventListener` interface. +## A Simple Example + Lets look at a simple example: we declare the empty class `SimpleEvent` that implements `IEvent` and can thus be used as an event. ```java @@ -42,4 +46,26 @@ public class SimpleEventListener implements EventListener { } ``` -In this case, an event bus is created and used locally. In a more sophisticated example the class would acquire an external event bus that is used by multiple classes. \ No newline at end of file +In this case, an event bus is created and used locally. In a more sophisticated example the class would acquire an external event bus that is used by multiple classes. + +## Installation + +Event Bus is currently hosted at [kske.dev](https://kske.dev). +To include it inside your project, just add the Maven repository and the dependency to your `pom.xml`: + +```xml + + + kske-repo + https://kske.dev/maven-repo + + + + + + dev.kske + event-bus + 0.0.1 + + +```