mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
Formatted code to follow google formatting guidelines using the Spotless formatter
This commit is contained in:
@@ -1,69 +1,66 @@
|
||||
package org.toop;
|
||||
|
||||
import org.toop.frontend.UI.LocalServerSelector;
|
||||
import org.toop.eventbus.EventRegistry;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.toop.backend.ServerManager;
|
||||
import org.toop.eventbus.Events;
|
||||
import org.toop.eventbus.GlobalEventBus;
|
||||
import org.toop.backend.ServerManager;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.toop.frontend.ConnectionManager;
|
||||
import org.toop.frontend.games.LocalTicTacToe;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import org.toop.frontend.UI.LocalServerSelector;
|
||||
|
||||
public class Main {
|
||||
private static final Logger logger = LogManager.getLogger(Main.class);
|
||||
private static boolean running = false;
|
||||
|
||||
public static void main(String[] args) throws ExecutionException, InterruptedException {
|
||||
// Logging.disableAllLogs();
|
||||
// Logging.enableAllLogsForClass(LocalTicTacToe.class);
|
||||
// Logging.enableLogsForClass(ServerManager.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(TicTacToeServer.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(TcpClient.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(ConnectionManager.class, Level.ALL);
|
||||
public static void main(String[] args) throws ExecutionException, InterruptedException {
|
||||
// Logging.disableAllLogs();
|
||||
// Logging.enableAllLogsForClass(LocalTicTacToe.class);
|
||||
// Logging.enableLogsForClass(ServerManager.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(TicTacToeServer.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(TcpClient.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(ConnectionManager.class, Level.ALL);
|
||||
initSystems();
|
||||
registerEvents();
|
||||
|
||||
// JFrame frame = new JFrame("Server Settings");
|
||||
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
// frame.setSize(800, 600);
|
||||
// frame.setLocationRelativeTo(null);
|
||||
// frame.setVisible(true);
|
||||
// JFrame frame = new JFrame("Server Settings");
|
||||
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
// frame.setSize(800, 600);
|
||||
// frame.setLocationRelativeTo(null);
|
||||
// frame.setVisible(true);
|
||||
|
||||
javax.swing.SwingUtilities.invokeLater(LocalServerSelector::new);
|
||||
javax.swing.SwingUtilities.invokeLater(LocalServerSelector::new);
|
||||
|
||||
// new Thread(() -> {
|
||||
// LocalServerSelector window = new LocalServerSelector();
|
||||
// }).start();
|
||||
// new Thread(() -> {
|
||||
// LocalServerSelector window = new LocalServerSelector();
|
||||
// }).start();
|
||||
|
||||
}
|
||||
|
||||
private static void registerEvents() {
|
||||
GlobalEventBus.subscribeAndRegister(Events.WindowEvents.OnQuitRequested.class, event -> {
|
||||
quit();
|
||||
});
|
||||
private static void registerEvents() {
|
||||
GlobalEventBus.subscribeAndRegister(
|
||||
Events.WindowEvents.OnQuitRequested.class,
|
||||
event -> {
|
||||
quit();
|
||||
});
|
||||
|
||||
GlobalEventBus.subscribeAndRegister(Events.WindowEvents.OnMouseMove.class, event -> {
|
||||
});
|
||||
}
|
||||
GlobalEventBus.subscribeAndRegister(Events.WindowEvents.OnMouseMove.class, event -> {});
|
||||
}
|
||||
|
||||
public static void initSystems() {
|
||||
new ServerManager();
|
||||
new ConnectionManager();
|
||||
}
|
||||
|
||||
private static void quit() {
|
||||
running = false;
|
||||
}
|
||||
private static void quit() {
|
||||
running = false;
|
||||
}
|
||||
|
||||
public static boolean isRunning() {
|
||||
return running;
|
||||
}
|
||||
public static boolean isRunning() {
|
||||
return running;
|
||||
}
|
||||
|
||||
public static void setRunning(boolean running) {
|
||||
Main.running = running;
|
||||
}
|
||||
public static void setRunning(boolean running) {
|
||||
Main.running = running;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user