25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package structures;
-
- import actors.GameActor;
- import structures.basic.AIPlayer;
-
- /**
- * This class can be used to hold information about the on-going game.
- * Its created with the GameActor.
- *
- * @author Dr. Richard McCreadie
- *
- */
- public class GameState {
- public boolean gameInitalised = false;
-
- public boolean something = false;
-
- public int currentPlayer = 1;
-
- 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;
- }
-
- /** 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);
- }
- }
|