mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 21:39:44 +01:00
Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui
This commit is contained in:
commit
1203077aed
@ -10,6 +10,10 @@ dependencies {
|
||||
implementation project(":monopoly:server")
|
||||
|
||||
implementation libs.jme3.desktop
|
||||
implementation libs.lemur
|
||||
implementation libs.lemurproto
|
||||
|
||||
implementation libs.selenium
|
||||
|
||||
runtimeOnly libs.jme3.awt.dialogs
|
||||
runtimeOnly libs.jme3.plugins
|
||||
|
@ -50,6 +50,14 @@ public class PlayerHandler {
|
||||
return players.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns all players
|
||||
* @return List of all players
|
||||
*/
|
||||
public List<Player> getPlayers() {
|
||||
return players;
|
||||
}
|
||||
|
||||
/**
|
||||
* Chechs if all players are ready to start the game
|
||||
* @return {@code true} if all players are ready, otherwise {@code false}
|
||||
|
@ -12,6 +12,7 @@ import pp.monopoly.message.client.RollDice;
|
||||
import pp.monopoly.message.client.TradeOffer;
|
||||
import pp.monopoly.message.client.TradeResponse;
|
||||
import pp.monopoly.message.client.ViewAssetsRequest;
|
||||
import pp.monopoly.message.server.GameStart;
|
||||
import pp.monopoly.message.server.ServerMessage;
|
||||
import pp.monopoly.message.server.TradeReply;
|
||||
import pp.monopoly.message.server.TradeRequest;
|
||||
@ -180,6 +181,12 @@ public class ServerGameLogic implements ClientInterpreter {
|
||||
playerHandler.setPlayerReady(player, true);
|
||||
LOGGER.log(Level.DEBUG, "Player {0} is ready", player.getName());
|
||||
}
|
||||
|
||||
if(playerHandler.allPlayersReady()) {
|
||||
for (Player p : playerHandler.getPlayers()) {
|
||||
send(p, new GameStart(playerHandler.getPlayers()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,21 @@
|
||||
package pp.monopoly.message.server;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import pp.monopoly.game.server.Player;
|
||||
|
||||
public class GameStart extends ServerMessage{
|
||||
|
||||
private final List<Player> players;
|
||||
|
||||
public GameStart(List<Player> players) {
|
||||
this.players = players;
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
return players;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
interpreter.received(this);
|
||||
|
@ -25,7 +25,9 @@ dependencyResolutionManagement {
|
||||
library('jme3-effects', 'org.jmonkeyengine', 'jme3-effects').versionRef('jme')
|
||||
|
||||
library('lemur', 'com.simsilica:lemur:1.16.0')
|
||||
library('lemur-proto', 'com.simsilica:lemur-proto:1.13.0')
|
||||
library('lemurproto', 'com.simsilica:lemur-proto:1.13.0')
|
||||
|
||||
library('selenium', 'org.seleniumhq.selenium:selenium-java:4.11.0')
|
||||
|
||||
library('junit4', 'junit:junit:4.13.2')
|
||||
library('gson', 'com.google.code.gson:gson:2.11.0')
|
||||
|
Loading…
Reference in New Issue
Block a user