|
|
@@ -11,17 +11,35 @@ import structures.basic.AIPlayer; |
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class GameState {
|
|
|
|
|
|
|
|
|
|
|
|
public boolean gameInitalised = false;
|
|
|
|
|
|
|
|
|
|
|
|
public boolean something = false;
|
|
|
|
|
|
|
|
public int currentPlayer = 1;
|
|
|
|
|
|
|
|
public AIPlayer aiPlayer = new AIPlayer();
|
|
|
|
private GameActor gameActor;
|
|
|
|
// note: still a bit of a hack but we remove this from GameState
|
|
|
|
// and give it to the AIPlayer on initialisation, and it can then
|
|
|
|
// be removed from here
|
|
|
|
public AIPlayer aiPlayer;
|
|
|
|
|
|
|
|
public GameState() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setGameActor(GameActor gameActor) {
|
|
|
|
this.gameActor = gameActor;
|
|
|
|
}
|
|
|
|
|
|
|
|
// bit of a hack but include a reference to the GameActor so AIPlayer can send messages to it
|
|
|
|
public GameActor gameActor;
|
|
|
|
|
|
|
|
/** Set up everything the game needs to be played (called via initialise game event)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public void setupGameState() {
|
|
|
|
// do game setup
|
|
|
|
this.gameInitalised = true;
|
|
|
|
// set initial player
|
|
|
|
this.currentPlayer = 1;
|
|
|
|
// create the AI player:
|
|
|
|
this.aiPlayer = new AIPlayer(this.gameActor);
|
|
|
|
}
|
|
|
|
}
|