Package com.csse3200.game.areas.weather
Class ClimateController
java.lang.Object
com.csse3200.game.areas.weather.ClimateController
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new climate controller that listens to time events and maintains the in-game climate -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWeatherEvent(WeatherEvent event) Adds a weather event to the list of weather events stored in the climate controller classGets the current weather event that is occurringReturns the event handler for the Climate controller classvoidInitialises the events and listeners for thisClimateController.voidread(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) voidGets the current weather event that is occurringvoidsetValues(com.badlogic.gdx.utils.JsonValue jsonData) voidUpdates the values of the game's climate based on current weather events.voidwrite(com.badlogic.gdx.utils.Json json)
-
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 thisClimateController. -
getEvents
Returns the event handler for the Climate controller class- Returns:
- Event handler
-
addWeatherEvent
Adds a weather event to the list of weather events stored in the climate controller class- Parameters:
event- Weather event- Throws:
IllegalArgumentException
-
getCurrentWeatherEvent
Gets the current weather event that is occurring- Returns:
- current weather event, null if not event is occurring
-
setCurrentWeatherEvent
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:
writein interfacecom.badlogic.gdx.utils.Json.Serializable
-
read
public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) - Specified by:
readin interfacecom.badlogic.gdx.utils.Json.Serializable
-
setValues
public void setValues(com.badlogic.gdx.utils.JsonValue jsonData)
-