Environment Utilities

Business

Civic Policies

Weathers

class CommonWeatherUtils

Bases: object

Utilities for manipulating the weather.

classmethod current_temperature_is_cold_or_freezing()

Determine if the current temperature is cold or freezing.

Returns:True, if the current temperature contains cold or freezing. False, if not.
Return type:bool
classmethod current_weather_contains_thunder_or_lightning()

Determine if the current weather contains lightning or thunder.

Returns:True, if the current weather contains thunder or lightning. False, if not.
Return type:bool
classmethod get_current_temperature()

Retrieve the current temperature.

Returns:The current temperature.
Return type:CommonTemperature
classmethod get_weather_cloud_type()

Retrieve the current cloud type.

Returns:The current cloud type or CLEAR if weather is not available.
Return type:CommonCloudType
classmethod get_weather_service()

Retrieve the service that handles the weather.

Returns:An instance of the service for handling weather or None if there is no weather service.
Return type:Union[WeatherService, None]
classmethod load_weather_event_by_id(weather_event)

Load an instance of a Weather Event by its identifier.

Parameters:weather_event (Union[int, CommonWeatherEventId, WeatherEvent]) – The identifier of a Weather Event.
Returns:An instance of a WeatherEvent matching the decimal identifier or None if not found.
Return type:Union[WeatherEvent, None]
classmethod start_weather_event(weather_event, duration_in_hours)

Start a weather event. Essentially changing the current weather.

Parameters:
  • weather_event (Union[int, CommonWeatherEventId, WeatherEvent]) – The identifier of the weather event to start.
  • duration_in_hours (int) – The number of Sim hours to run the weather event for.
classmethod weather_effect_is_active(weather_effect_type)

Determine if the specified weather effect is currently active.

Parameters:weather_effect_type (CommonWeatherEffectType) – The weather effect to check for.
Returns:True, if the weather is active. False, if it is not.
Return type:bool
classmethod weather_effects_are_active(weather_effect_types)

Determine if any of the specified weather effects are currently active.

Parameters:weather_effect_types (Iterator[CommonWeatherEffectType]) – An iterator of weather effects to check for.
Returns:True, if any of the weathers is active. False, if none of the weathers are active.
Return type:bool