Class ClimateController

java.lang.Object
com.csse3200.game.areas.weather.ClimateController
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable

public class ClimateController extends Object implements com.badlogic.gdx.utils.Json.Serializable
  • Constructor Details

    • ClimateController

      public ClimateController()
      Creates a new climate controller that listens to time events and maintains the in-game climate
  • Method Details

    • initialiseEvents

      public void initialiseEvents()
      Initialises the events and listeners for this ClimateController.
    • getEvents

      public EventHandler getEvents()
      Returns the event handler for the Climate controller class
      Returns:
      Event handler
    • addWeatherEvent

      public void addWeatherEvent(WeatherEvent event) throws IllegalArgumentException
      Adds a weather event to the list of weather events stored in the climate controller class
      Parameters:
      event - Weather event
      Throws:
      IllegalArgumentException
    • getCurrentWeatherEvent

      public WeatherEvent getCurrentWeatherEvent()
      Gets the current weather event that is occurring
      Returns:
      current weather event, null if not event is occurring
    • setCurrentWeatherEvent

      public void setCurrentWeatherEvent(WeatherEvent event)
      Gets the current weather event that is occurring
    • updateClimate

      public void updateClimate()
      Updates the values of the game's climate based on current weather events. Factoring in the in-game time and the weather event modifiers.
    • write

      public void write(com.badlogic.gdx.utils.Json json)
      Specified by:
      write in interface com.badlogic.gdx.utils.Json.Serializable
    • read

      public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData)
      Specified by:
      read in interface com.badlogic.gdx.utils.Json.Serializable
    • setValues

      public void setValues(com.badlogic.gdx.utils.JsonValue jsonData)