Fix NullPointerException in App.java
This commit is contained in:
parent
9cfa56be8d
commit
b08139ebca
@ -38,10 +38,10 @@ public class App extends Application {
|
||||
public static void startGame() throws IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
|
||||
InstantiationException, IllegalAccessException {
|
||||
List<Player> 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() {
|
||||
|
@ -28,11 +28,7 @@ public class Game {
|
||||
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user