No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

GameState.java 1.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. }