WIP: Adapted the old server thread class to the GameServerThread class to allow multiple clients to connect

tags: #story[1047]  #pair[wmu16, mra106]
This commit is contained in:
William Muir
2017-07-11 17:03:32 +12:00
parent 752863a0d3
commit 035841f221
11 changed files with 515 additions and 132 deletions
@@ -10,14 +10,15 @@ import java.util.ArrayList;
*/
public class GameState {
public static final Integer MAX_NUM_PLAYERS = 10;
private static String hostIpAddress;
private static ArrayList<Player> players;
private static Boolean isRaceStarted;
private static GameStages currentStage;
public GameState(String hostIpAddress) {
GameState.hostIpAddress = hostIpAddress;
players = new ArrayList<>();
currentStage = GameStages.LOBBYING;
isRaceStarted = false;
}
@@ -41,6 +42,13 @@ public class GameState {
return isRaceStarted;
}
public static GameStages getCurrentStage() {
return currentStage;
}
public static void setCurrentStage(GameStages currentStage) {
GameState.currentStage = currentStage;
}
/**
* This iterates through all players and updates each players info to its new state based on its current data
@@ -50,8 +58,8 @@ public class GameState {
// TODO: 10/07/17 wmu16 - Update all player info
}
}
}