diff --git a/client/src/main/java/fr/lnl/game/client/App.java b/client/src/main/java/fr/lnl/game/client/App.java index 598f4ef..63edc84 100644 --- a/client/src/main/java/fr/lnl/game/client/App.java +++ b/client/src/main/java/fr/lnl/game/client/App.java @@ -38,10 +38,10 @@ public class App extends Application { public static void startGame() throws IllegalArgumentException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { List players = parsePlayers(); + game = new Game(new Grid(12, 12, players), players); for (Player player : game.getPlayers()) { playerList.put(player, new ClientPlayer(player, new Terminal(game, player))); } - game = new Game(new Grid(12, 12, players), players); } public static void updateView() { diff --git a/server/src/main/java/fr/lnl/game/server/games/Game.java b/server/src/main/java/fr/lnl/game/server/games/Game.java index 8fae549..706c439 100644 --- a/server/src/main/java/fr/lnl/game/server/games/Game.java +++ b/server/src/main/java/fr/lnl/game/server/games/Game.java @@ -27,12 +27,8 @@ public class Game { this.currentPlayer = players.get(0); this.grid = grid; } - - /** - * - * @return game winner - */ - public Player play() { + + public void play() { while(!isOver()) { ModelListener awakeEvent = new AwakeGame(this); generateAndGetPlayerActions(currentPlayer); @@ -41,7 +37,6 @@ public class Game { selectedAction.doAction(); nextCurrentPlayer(); } - return getWinner(); } private void waitForInterfaceEvent() {