fix: implemented proper game start in Lobby
This commit is contained in:
parent
2995564cdf
commit
c56a356994
@ -1,6 +1,7 @@
|
|||||||
package uulm.teamname.marvelous.server.lobby;
|
package uulm.teamname.marvelous.server.lobby;
|
||||||
|
|
||||||
import org.tinylog.Logger;
|
import org.tinylog.Logger;
|
||||||
|
import uulm.teamname.marvelous.gamelibrary.config.CharacterProperties;
|
||||||
import uulm.teamname.marvelous.gamelibrary.entities.EntityType;
|
import uulm.teamname.marvelous.gamelibrary.entities.EntityType;
|
||||||
import uulm.teamname.marvelous.gamelibrary.events.Event;
|
import uulm.teamname.marvelous.gamelibrary.events.Event;
|
||||||
import uulm.teamname.marvelous.gamelibrary.events.EventBuilder;
|
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 uulm.teamname.marvelous.server.lobbymanager.Participant;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class Lobby {
|
public class Lobby {
|
||||||
private final String gameID;
|
private final String gameID;
|
||||||
@ -42,7 +44,9 @@ public class Lobby {
|
|||||||
LobbyConnection connection,
|
LobbyConnection connection,
|
||||||
PartyConfig partyConfig,
|
PartyConfig partyConfig,
|
||||||
CharacterConfig characterConfig,
|
CharacterConfig characterConfig,
|
||||||
ScenarioConfig scenarioConfig) {
|
ScenarioConfig scenarioConfig,
|
||||||
|
List<Integer> player1Characters,
|
||||||
|
List<Integer> player2Characters) {
|
||||||
|
|
||||||
this.gameID = gameID;
|
this.gameID = gameID;
|
||||||
this.connection = connection;
|
this.connection = connection;
|
||||||
@ -71,7 +75,9 @@ public class Lobby {
|
|||||||
partyConfig.maxRoundTime,
|
partyConfig.maxRoundTime,
|
||||||
this::turnTimeout);
|
this::turnTimeout);
|
||||||
|
|
||||||
this.connection.broadcastEvents(game.getGameStateEvent());
|
var response = this.game.startGame(player1Characters, player2Characters);
|
||||||
|
|
||||||
|
this.connection.broadcastEvents(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user