mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +00:00
refactor
This commit is contained in:
@@ -16,7 +16,7 @@ public class Events implements IEvent {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Object get(String eventName, Object... args) throws Exception {
|
||||
Class<?> clazz = Class.forName("org.toop.eventbus.events.Events$ServerEvents$" + eventName);
|
||||
Class<?> clazz = Class.forName("org.toop.framework.eventbus.events.Events$ServerEvents$" + eventName);
|
||||
Class<?>[] paramTypes = Arrays.stream(args).map(Object::getClass).toArray(Class<?>[]::new);
|
||||
Constructor<?> constructor = clazz.getConstructor(paramTypes);
|
||||
return constructor.newInstance(args);
|
||||
@@ -34,7 +34,7 @@ public class Events implements IEvent {
|
||||
public static Object get(String eventCategory, String eventName, Object... args)
|
||||
throws Exception {
|
||||
Class<?> clazz =
|
||||
Class.forName("org.toop.eventbus.events.Events$" + eventCategory + "$" + eventName);
|
||||
Class.forName("org.toop.framework.eventbus.events.Events$" + eventCategory + "$" + eventName);
|
||||
Class<?>[] paramTypes = Arrays.stream(args).map(Object::getClass).toArray(Class<?>[]::new);
|
||||
Constructor<?> constructor = clazz.getConstructor(paramTypes);
|
||||
return constructor.newInstance(args);
|
||||
@@ -50,7 +50,7 @@ public class NetworkEvents extends Events {
|
||||
* @param ip The IP address of the server to connect to.
|
||||
* @param port The port number of the server to connect to.
|
||||
* @param eventId A unique identifier for this event, typically injected
|
||||
* automatically by the {@link org.toop.eventbus.EventPublisher}.
|
||||
* automatically by the {@link org.toop.framework.eventbus.EventPublisher}.
|
||||
*/
|
||||
public record StartClient(
|
||||
Supplier<? extends NetworkingGameClientHandler> handlerFactory,
|
||||
@@ -6,7 +6,7 @@ import java.util.function.Supplier;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.toop.eventbus.EventPublisher;
|
||||
import org.toop.framework.eventbus.EventPublisher;
|
||||
import org.toop.framework.eventbus.events.NetworkEvents;
|
||||
|
||||
public class NetworkingClientManager {
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.toop.eventbus;
|
||||
package org.toop.framework.eventbus;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.toop.framework.eventbus.GlobalEventBus;
|
||||
import org.toop.framework.eventbus.events.EventWithUuid;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.toop.eventbus;
|
||||
package org.toop.framework.eventbus;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.toop.eventbus;
|
||||
package org.toop.framework.eventbus;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.toop.framework.eventbus.events.EventWithUuid;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//package org.toop.eventbus;
|
||||
//package org.toop.framework.eventbus;
|
||||
//
|
||||
//import net.engio.mbassy.bus.publication.SyncAsyncPostCommand;
|
||||
//import org.junit.jupiter.api.AfterEach;
|
||||
//import org.junit.jupiter.api.Test;
|
||||
//import org.toop.eventbus.events.IEvent;
|
||||
//import org.toop.framework.eventbus.events.IEvent;
|
||||
//
|
||||
//import java.util.concurrent.atomic.AtomicBoolean;
|
||||
//import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
Reference in New Issue
Block a user