diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java index 4aa383e..b96ebaf 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java @@ -1,6 +1,7 @@ package uulm.teamname.marvelous.server.lobby; import org.tinylog.Logger; +import uulm.teamname.marvelous.gamelibrary.config.CharacterProperties; import uulm.teamname.marvelous.gamelibrary.entities.EntityType; import uulm.teamname.marvelous.gamelibrary.events.Event; import uulm.teamname.marvelous.gamelibrary.events.EventBuilder; @@ -16,6 +17,7 @@ import uulm.teamname.marvelous.server.lobbymanager.LobbyConnection; import uulm.teamname.marvelous.server.lobbymanager.Participant; import java.util.*; +import java.util.stream.Collectors; public class Lobby { private final String gameID; @@ -42,7 +44,9 @@ public class Lobby { LobbyConnection connection, PartyConfig partyConfig, CharacterConfig characterConfig, - ScenarioConfig scenarioConfig) { + ScenarioConfig scenarioConfig, + List player1Characters, + List player2Characters) { this.gameID = gameID; this.connection = connection; @@ -71,7 +75,9 @@ public class Lobby { partyConfig.maxRoundTime, this::turnTimeout); - this.connection.broadcastEvents(game.getGameStateEvent()); + var response = this.game.startGame(player1Characters, player2Characters); + + this.connection.broadcastEvents(response); } /**