public class ReplayGame extends CoreGame
Constructor and Description |
---|
ReplayGame(java.lang.String Player1Name,
java.lang.String Player2Name,
org.json.simple.JSONObject gameData)
Creates an instance of ReplayGame, this game mode loads a saved mode from JSON and allows the user to watch it back at their own pace.
|
Modifier and Type | Method and Description |
---|---|
void |
addNewConnections()
checks the current connections are the same as those in the json.
|
void |
addNewTrains()
Adds any new trains this turn that the player has bought!
|
void |
addObstacle(org.json.simple.JSONObject obstacle,
Train train)
Update trains method.
|
void |
addStationFaults()
runs through the array of station faults in our JSON - removing any that have been fixed and adding any that have become faulty this turn
|
void |
addStationLocks()
Lock and unlock stations from this turn
|
void |
animationComplete() |
void |
buyNewStations()
Adds any new stations this turn that the player has bought!
|
org.json.simple.JSONObject |
currentPlayerJSON() |
void |
EndTurn()
Ends the turn of a player.
|
void |
StartTurn()
Starts a players turn.
|
boolean |
togglePaused() |
void |
updateGoals()
updates goals from the json each turn, removes any completed/deleted goals
|
void |
updatePlayerCards()
Updates the cards belonging to each player to match the way they were in the saved game.
|
void |
updatePlayerScores()
Player scores are updated from the JSON file every turn so that they stay correct.
|
void |
updateResources()
updates the players resources each turn to match the json
|
getBaseResources, getGameMap, getNonPlayerTurn, getPlayer1, getPlayer2, getPlayerTurn, getTurnCount, getTurnLimit, hasFinished
public ReplayGame(java.lang.String Player1Name, java.lang.String Player2Name, org.json.simple.JSONObject gameData)
Player1Name
- Player2Name
- gameData
- public void StartTurn()
public void buyNewStations()
public void addNewTrains()
public org.json.simple.JSONObject currentPlayerJSON()
public void updateResources()
public void updateGoals()
public void updatePlayerScores()
public void addStationFaults()
public void addStationLocks()
public void addNewConnections()
public boolean togglePaused()
public void animationComplete()
public void updatePlayerCards()
public void EndTurn()
public void addObstacle(org.json.simple.JSONObject obstacle, Train train)