Class SaveGame.GameState

java.lang.Object
com.csse3200.game.files.SaveGame.GameState
Enclosing class:
SaveGame

public static class SaveGame.GameState extends Object
Stores game state. Can be serialised/deserialised.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the ClimateController that is stored within the GameState
    int
    Gets the day value stored in the GameState
    com.badlogic.gdx.utils.Array<Entity>
    Gets the entities that are used in save/load
    int
    Gets the hour value stored in the GameState
    int
    Gets the in game minute that is stored within the GameState
    Gets the MissionManager that is stored within the GameState
    float
    Gets the oxygenLevel value stored in the GameState
    com.badlogic.gdx.utils.Array<Entity>
    Gets the entities that are used in save/load
    Gets the player entity stored in the GameState
    com.badlogic.gdx.utils.Array<Entity>
    Gets the entities that are used in save/load
    Gets the Tractor entity stored within the GameState
    void
    Gets the ClimateController that is stored within the GameState
    void
    setDay(int day)
    Sets the day value stored in the GameState
    void
    setEntities(com.badlogic.gdx.utils.Array<Entity> entities)
    Sets the entities that are used in save/load (filtered by filterEntities() first)
    void
    setHour(int hour)
    Sets the hour value stored in the GameState
    void
    setMinute(int minute)
    Gets the in game minute that is stored within the GameState
    void
    Gets the MissionManager that is stored within the GameState
    void
    setOxygenLevel(float oxygenLevel)
    Sets the oxygenLevel value stored in the GameState
    void
    setPlaceables(com.badlogic.gdx.utils.Array<Entity> placeables)
    Sets the entities that are used in save/load (filtered by filterPlaceables() first)
    void
    setPlayer(Entity player)
    Sets the player entity stored in the GameState
    void
    setTiles(com.badlogic.gdx.utils.Array<Entity> tiles)
    Sets the entities that are used in save/load (filtered by filterTiles() first)
    void
    setTractor(Entity tractor)
    Gets the Tractor entity stored within the GameState

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GameState

      public GameState()
  • Method Details

    • getDay

      public int getDay()
      Gets the day value stored in the GameState
      Returns:
      the in game day as an int
    • setDay

      public void setDay(int day)
      Sets the day value stored in the GameState
      Parameters:
      day - the day to set GameState to store
    • getHour

      public int getHour()
      Gets the hour value stored in the GameState
      Returns:
      the in game hour as an int
    • setHour

      public void setHour(int hour)
      Sets the hour value stored in the GameState
      Parameters:
      hour - the hour to set GameState to store
    • getOxygenLevel

      public float getOxygenLevel()
      Gets the oxygenLevel value stored in the GameState
      Returns:
      the in game oxygenLevel as an int
    • setOxygenLevel

      public void setOxygenLevel(float oxygenLevel)
      Sets the oxygenLevel value stored in the GameState
      Parameters:
      oxygenLevel - the oxygenLevel to set GameState to store
    • getPlayer

      public Entity getPlayer()
      Gets the player entity stored in the GameState
      Returns:
      the player entity stored in the GameState
    • setPlayer

      public void setPlayer(Entity player)
      Sets the player entity stored in the GameState
      Parameters:
      player - the player entity to store in the GameState
    • getEntities

      public com.badlogic.gdx.utils.Array<Entity> getEntities()
      Gets the entities that are used in save/load
      Returns:
      All entities that are stored in the GameState that were not filtered out from filterEntities()
    • setEntities

      public void setEntities(com.badlogic.gdx.utils.Array<Entity> entities)
      Sets the entities that are used in save/load (filtered by filterEntities() first)
      Parameters:
      entities - All entities in the game or at least a relevant subset of them
    • getTiles

      public com.badlogic.gdx.utils.Array<Entity> getTiles()
      Gets the entities that are used in save/load
      Returns:
      All entities that are stored in the GameState that were not filtered out from filterTiles()
    • setTiles

      public void setTiles(com.badlogic.gdx.utils.Array<Entity> tiles)
      Sets the entities that are used in save/load (filtered by filterTiles() first)
      Parameters:
      tiles - All entities in the game or at least a relevant subset of them
    • getTractor

      public Entity getTractor()
      Gets the Tractor entity stored within the GameState
      Returns:
      the tractor entity within the GameState, or null if none
    • setTractor

      public void setTractor(Entity tractor)
      Gets the Tractor entity stored within the GameState
      Parameters:
      tractor - the tractor entity within the GameState, or null if none
    • getClimate

      public ClimateController getClimate()
      Gets the ClimateController that is stored within the GameState
      Returns:
      the ClimateController that is stored within the GameState
    • setClimate

      public void setClimate(ClimateController climate)
      Gets the ClimateController that is stored within the GameState
      Parameters:
      climate - the ClimateController that is stored within the GameState
    • getMissions

      public MissionManager getMissions()
      Gets the MissionManager that is stored within the GameState
      Returns:
      the MissionManager that is stored within the GameState
    • setMissions

      public void setMissions(MissionManager missions)
      Gets the MissionManager that is stored within the GameState
      Parameters:
      missions - the MissionManager that is stored within the GameState
    • getMinute

      public int getMinute()
      Gets the in game minute that is stored within the GameState
      Returns:
      the in game minute that is stored within the GameState
    • setMinute

      public void setMinute(int minute)
      Gets the in game minute that is stored within the GameState
      Parameters:
      minute - the in game minute that is stored within the GameState
    • getPlaceables

      public com.badlogic.gdx.utils.Array<Entity> getPlaceables()
      Gets the entities that are used in save/load
      Returns:
      All entities that are stored in the GameState that were not filtered out from filterPlaceables()
    • setPlaceables

      public void setPlaceables(com.badlogic.gdx.utils.Array<Entity> placeables)
      Sets the entities that are used in save/load (filtered by filterPlaceables() first)
      Parameters:
      placeables - All entities in the game or at least a relevant subset of them