Package model

Class Game

java.lang.Object
model.Game
All Implemented Interfaces:
Serializable

public class Game extends Object implements Serializable
Game class implementation for Double Trouble Kingdom, connects different game systems, contains methods for managing the state of game.
See Also:
  • Constructor Details

    • Game

      public Game(Database database, Map mapReference, String p1Name, String p2Name)
      Constructs a Game with dependency injection of Database and Map.
      Parameters:
      database - the Database to be injected
      mapReference - the Map to be injected
      p1Name - the name of Player1
      p2Name - the name of Player2
    • Game

      public Game(Map mapReference)
      Constructs a Game for Editor use.
      Parameters:
      mapReference - the Map to be injected
    • Game

      public Game(Game game)
      Copy Constructor for Game.
      Parameters:
      game - the Game to be copied
  • Method Details

    • getMapReference

      public static Map getMapReference()
      Returns the Map of the Game.
      Returns:
      the Map of the Game
    • getMap

      public Map getMap()
      Returns the Map of the game.
      Returns:
      the Map of the game
    • restartGame

      public void restartGame()
      Start a new Game.
    • pauseGame

      public void pauseGame()
      Pause the running Game.
    • getGameState

      public GameState getGameState()
      Returns the GameState of the Game.
      Returns:
      the GameState of the Game
    • getDatabase

      public Database getDatabase()
      Returns the Database of the Game.
      Returns:
      the Database of the Game