25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 lines
1.1 KiB

  1. package structures;
  2. import actors.GameActor;
  3. import structures.basic.AIPlayer;
  4. /**
  5. * This class can be used to hold information about the on-going game.
  6. * Its created with the GameActor.
  7. *
  8. * @author Dr. Richard McCreadie
  9. *
  10. */
  11. public class GameState {
  12. public boolean gameInitalised = false;
  13. public boolean something = false;
  14. public int currentPlayer = 1;
  15. private GameActor gameActor;
  16. // note: still a bit of a hack but we remove this from GameState
  17. // and give it to the AIPlayer on initialisation, and it can then
  18. // be removed from here
  19. public AIPlayer aiPlayer;
  20. public GameState() {
  21. super();
  22. }
  23. public void setGameActor(GameActor gameActor) {
  24. this.gameActor = gameActor;
  25. }
  26. /** Set up everything the game needs to be played (called via initialise game event)
  27. *
  28. */
  29. public void setupGameState() {
  30. // do game setup
  31. this.gameInitalised = true;
  32. // set initial player
  33. this.currentPlayer = 1;
  34. // create the AI player:
  35. this.aiPlayer = new AIPlayer(this.gameActor);
  36. }
  37. }