Interface GameManagerInterface


public interface GameManagerInterface
Interface the game manager implements. Acts as a interface between the front and back end.
  • Method Details

    • isGameRunning

      boolean isGameRunning()
      Returns whether there is a instance of the game running.
      Returns:
      true if there is a game running, false if not.
    • getCurrentDifficulty

      DifficultyEnum getCurrentDifficulty()
      Returns the current difficulty of the current run.
      Returns:
      the current difficulty of the current run.
    • startNewGame

      void startNewGame(DifficultyEnum difficulty)
      Starts a new game, with difficulty. Sends SessionStartEvent to telemetry listener.
      Parameters:
      difficulty - the difficulty to start the game on.
    • getCurrentRun

      GameRunInterface getCurrentRun()
      Returns the current game run.
      Returns:
      the current game run.
    • getCurrentPlayer

      PlayerInterface getCurrentPlayer()
      Returns the current player.
      Returns:
      the current player.
    • pickEncounter

      EncounterInterface pickEncounter()
      Picks a new (random) encounter/fight for the current level. Stored as the current encounter.
      Returns:
      the new chosen encounter.
    • getCurrentEncounter

      EncounterInterface getCurrentEncounter()
      Returns the current encounter/fight within a level.
      Returns:
      the current encounter/fight within a level.
    • resetFailedEncounter

      void resetFailedEncounter()
      Resets the current encounter if failed.
    • completeCurrentEncounter

      void completeCurrentEncounter()
      Completes the current encounter if won.
    • advanceToNextLevel

      void advanceToNextLevel()
      Advances to the next level (Encounter(s) completed).
    • viewShop

      UpgradeEnum[] viewShop()
      Opens shop interface after level completion. Returns all upgrades available in the shop.
      Returns:
      all upgrades available in the shop.
    • purchaseUpgrade

      void purchaseUpgrade(UpgradeEnum upgrade) throws LackingResourceException
      Attempts to purchase an upgrade from the shop. Checks if the player has enough currency to purchase specified upgrade. if not, throws an exception.
      Parameters:
      upgrade - the upgrade being bought from the shop.
      Throws:
      LackingResourceException - if the player doesn't have enough coins to buy the upgrade.
    • endGame

      void endGame()
      Ends current game. Sends EndSession to telemetry listener. Returns to main menu and resets game data --- no save.
    • getSessionID

      int getSessionID()
      Gets the ID for the current run's session.
      Returns:
      the session ID for the current run.