refactor: removed callback in constructor

This commit is contained in:
Yannik Bretschneider 2021-06-06 12:47:09 +02:00
parent 07d440bfac
commit cbdb2017b8

View File

@ -17,11 +17,9 @@ import java.util.function.BiConsumer;
public class LobbyManager { public class LobbyManager {
private final HashMap<Participant, LobbyConnection> lobbies; private final HashMap<Participant, LobbyConnection> lobbies;
private final HashMap<String, LobbyConnection> resourceDescriptorToLobby; private final HashMap<String, LobbyConnection> resourceDescriptorToLobby;
private final BiConsumer<Participant, BasicMessage> sendMessageCallback;
private String localResourceDescriptor; private String localResourceDescriptor;
public LobbyManager(BiConsumer<Participant, BasicMessage> sendMessageCallback) { public LobbyManager() {
this.sendMessageCallback = sendMessageCallback;
this.lobbies = new HashMap<>(); this.lobbies = new HashMap<>();
this.resourceDescriptorToLobby = new HashMap<>(); this.resourceDescriptorToLobby = new HashMap<>();
} }
@ -92,7 +90,7 @@ public class LobbyManager {
} }
private LobbyConnection initializeNewLobby(String gameID) { private LobbyConnection initializeNewLobby(String gameID) {
return new LobbyConnection(gameID, sendMessageCallback); return new LobbyConnection(gameID);
} }
/** /**