Class GameModel

java.lang.Object
dev.mikita.darkforest.model.GameModel

public class GameModel extends Object
The type Game model.

The main class responsible for the state of the game (game objects).

  • Constructor Details

    • GameModel

      public GameModel()
  • Method Details

    • init

      public void init(boolean fromSave)
      Init.

      Initialization of the game world. Loading locations, game objects, etc.

      Parameters:
      fromSave - the from save
    • getInstance

      public static GameModel getInstance()
      Gets instance.
      Returns:
      the instance
    • setLocation

      public void setLocation(int locationId)
      Sets location.

      A method that allows you to change the location.

      Parameters:
      locationId - the location id
    • getTileMap

      public TileMap getTileMap()
      Gets tile map.
      Returns:
      The tile map.
    • getMonsters

      public ArrayList<Monster> getMonsters()
      Gets monsters.
      Returns:
      The monsters.
    • getItems

      public ArrayList<AItem> getItems()
      Gets items.
      Returns:
      The items.
    • getPortals

      public ArrayList<Portal> getPortals()
      Gets portals.
      Returns:
      The portals.
    • getSpriteManager

      public SpriteManager getSpriteManager()
      Gets sprite manager.
      Returns:
      The sprite manager.
    • getPlayer

      public Player getPlayer()
      Gets player.
      Returns:
      The player.
    • getCurrentLocation

      public Location getCurrentLocation()
      Gets current location.
      Returns:
      The current location.