Disabled error prone for now. Improved eventflow speed

This commit is contained in:
lieght
2025-09-24 22:04:00 +02:00
parent e6e11a3604
commit 7431d1b03f
21 changed files with 564 additions and 393 deletions

View File

@@ -7,7 +7,7 @@ import javax.swing.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.toop.framework.eventbus.EventFlow;
import org.toop.framework.eventbus.events.NetworkEvents;
import org.toop.framework.networking.events.NetworkEvents;
import org.toop.tictactoe.LocalTicTacToe;
import org.toop.framework.networking.NetworkingGameClientHandler;
import org.toop.tictactoe.gui.UIGameBoard;

View File

@@ -1,25 +1,25 @@
package org.toop.events;
import org.toop.framework.eventbus.events.EventWithoutUuid;
import org.toop.framework.eventbus.events.Events;
import org.toop.framework.eventbus.events.EventWithoutSnowflake;
import org.toop.framework.eventbus.events.EventsBase;
public class WindowEvents extends Events {
public class WindowEvents extends EventsBase {
/** Triggers when a cell is clicked in one of the game boards. */
public record CellClicked(int cell) implements EventWithoutUuid {}
public record CellClicked(int cell) implements EventWithoutSnowflake {}
/** Triggers when the window wants to quit. */
public record OnQuitRequested() implements EventWithoutUuid {}
public record OnQuitRequested() implements EventWithoutSnowflake {}
/** Triggers when the window is resized. */
// public record OnResize(Window.Size size) implements EventWithoutUuid {}
// public record OnResize(Window.Size size) implements EventWithoutSnowflake {}
/** Triggers when the mouse is moved within the window. */
public record OnMouseMove(int x, int y) implements EventWithoutUuid {}
public record OnMouseMove(int x, int y) implements EventWithoutSnowflake {}
/** Triggers when the mouse is clicked within the window. */
public record OnMouseClick(int button) implements EventWithoutUuid {}
public record OnMouseClick(int button) implements EventWithoutSnowflake {}
/** Triggers when the mouse is released within the window. */
public record OnMouseRelease(int button) implements EventWithoutUuid {}
public record OnMouseRelease(int button) implements EventWithoutSnowflake {}
}

View File

@@ -5,12 +5,10 @@ import java.util.concurrent.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.toop.framework.eventbus.EventFlow;
import org.toop.framework.eventbus.events.Events;
import org.toop.framework.eventbus.events.NetworkEvents;
import org.toop.framework.networking.events.NetworkEvents;
import org.toop.game.GameBase;
import org.toop.tictactoe.gui.UIGameBoard;
import org.toop.framework.networking.NetworkingGameClientHandler;
import org.toop.tictactoe.TicTacToeAI;
import java.util.function.Supplier;