Environment Utilities

Business

class CommonBusinessUtils

Bases: object

Utilities for manipulating Businesses.

classmethod get_business_funds_by_zone_id(zone_id)

Retrieve the Funds object that manages the Simoleons for the Business of a Zone.

Parameters:

zone_id (int, optional) – The identifier of the Zone to retrieve a Business from. Default is the current zone.

Returns:

The BusinessFunds object of the Business at the specified zone or None if the specified Zone did not have a Business.

Return type:

Union[BusinessFunds, None]

classmethod get_business_funds_for_current_zone()

Retrieve the Funds object that manages the Simoleons for the Business of the current Zone.

Returns:

The BusinessFunds object of the Business at the current Zone or None if the current Zone did not have a Business.

Return type:

Union[BusinessFunds, None]

classmethod get_business_manager_by_zone_id(zone_id)

Retrieve a Business Manager for a Zone.

Parameters:

zone_id (int) – The identifier of the Zone to retrieve a Business Manager from.

Returns:

A Business Manager for the specified zone.

Return type:

BusinessManager

classmethod get_business_manager_for_current_zone()

Retrieve a Business Manager for the current Zone.

Returns:

A Business Manager for the current zone.

Return type:

BusinessManager

classmethod get_business_service()

Retrieve an instance of the Business Service.

Returns:

An instance of the Business Service.

Return type:

BusinessService

classmethod is_customer_of_business(sim_info, business_manager)

Determine if a Sim is a customer of the specified business.

Parameters:
  • sim_info (SimInfo) – The info of a Sim.

  • business_manager (BusinessManager) – The business manager to check.

Returns:

True, if the Sim is a customer of the specified Business. False, if not.

Return type:

bool

classmethod is_employee_of_business(sim_info, business_manager)

Determine if a Sim is an employee of the specified business.

Parameters:
  • sim_info (SimInfo) – The info of a Sim.

  • business_manager (BusinessManager) – The business manager to check.

Returns:

True, if the Sim is an employee of the specified Business. False, if not.

Return type:

bool

Civic Policies

class CommonCivicPolicyUtils

Bases: _HasS4CLClassLog

Utilities for manipulating civic policies.

classmethod get_log_identifier()

A string identifier for the log of the class.

Note

This is the text that will appear when logging messages.

Returns:

The identifier for the log

Return type:

str

classmethod get_street_civic_policies_by_zone_id(zone_id, policy_status)

Retrieve Street Civic Policies with the specifies status from the specified zone.

Parameters:
  • zone_id (int) – The identifier of the Zone to retrieve the civic policies from.

  • policy_status (CommonCivicPolicyStatusType) – The status of the policies to look for.

Returns:

A collection of Street Civic Policies with the specified status from the specified zone.

Return type:

Tuple[StreetCivicPolicy]

classmethod get_street_civic_policies_in_current_zone(policy_status)

Retrieve Street Civic Policies with the specifies status from the current zone.

Parameters:

policy_status (CommonCivicPolicyStatusType) – The status of the policies to look for.

Returns:

A collection of Street Civic Policies with the specified status from the current zone.

Return type:

Tuple[StreetCivicPolicy]

classmethod get_street_civic_policy_provider_by_world_id(world_id)

Retrieve the Street Civic Policy Provider for a World.

Parameters:

world_id (int) – The identifier of the World to retrieve the civic policy provider from.

Returns:

The Street Civic Policy Provider for the specified World or None if the street service is unavailable or there is no street for the specified World.

Return type:

Union[StreetProvider, None]

classmethod get_street_civic_policy_provider_by_zone_id(zone_id)

Retrieve the Street Civic Policy Provider for a Zone.

Parameters:

zone_id (int) – The identifier of the Zone to retrieve the civic policy provider from.

Returns:

The Street Civic Policy Provider for the specified Zone or None if the street service is unavailable or there is no street for the specified Zone.

Return type:

Union[StreetProvider, None]

classmethod get_street_civic_policy_provider_for_current_zone()

Retrieve the Street Civic Policy Provider for the current Zone.

Returns:

The Street Civic Policy Provider for the current Zone or None if the street service is unavailable or there is no street for the current Zone.

Return type:

Union[StreetProvider, None]

classmethod get_venue_civic_policies_by_zone_id(zone_id, policy_status)

Retrieve Venue Civic Policies with the specifies status from the specified zone.

Parameters:
  • zone_id (int) – The identifier of the Zone to retrieve the civic policies from.

  • policy_status (CommonCivicPolicyStatusType) – The status of the policies to look for.

Returns:

A collection of Venue Civic Policies with the specified status from the specified zone.

Return type:

Tuple[VenueCivicPolicy]

classmethod get_venue_civic_policies_in_current_zone(policy_status)

Retrieve Venue Civic Policies with the specifies status from the current zone.

Parameters:

policy_status (CommonCivicPolicyStatusType) – The status of the policies to look for.

Returns:

A collection of Venue Civic Policies with the specified status from the current zone.

Return type:

Tuple[VenueCivicPolicy]

classmethod get_venue_civic_policy_provider_by_zone_id(zone_id)

Retrieve the Venue Civic Policy Provider for a Zone.

Parameters:

zone_id (int) – The identifier of the Zone to retrieve the civic policy provider from.

Returns:

The Venue Civic Policy Provider for the specified Zone or None if the specified Zone does not have a venue.

Return type:

Union[VenueCivicPolicyProvider, None]

classmethod get_venue_civic_policy_provider_for_current_zone()

Retrieve the Venue Civic Policy Provider for a Zone.

Returns:

The Venue Civic Policy Provider for the current Zone or None if the current Zone does not have a venue.

Return type:

Union[VenueCivicPolicyProvider, None]

classmethod is_dormant_in_current_zone(policy)

Determine if a Policy is currently up for repeal in the current Zone.

Parameters:

policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently up for repeal in the current Zone. False, if not.

Return type:

bool

classmethod is_dormant_in_zone(zone_id, policy)

Determine if a Policy is currently up for repeal in a Zone.

Parameters:
  • zone_id (int) – The identifier of the Zone to check.

  • policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently up for repeal in a Zone. False, if not.

Return type:

bool

classmethod is_free_love_enacted()

Determine if the Free Love civic policy has been enacted in the current zone.

Returns:

True, if the policy is enacted. False, if not.

Return type:

bool

classmethod is_policy_balloted_in_current_zone(policy)

Determine if a Policy is currently balloted in the current Zone.

Parameters:

policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently balloted in the current Zone. False, if not.

Return type:

bool

classmethod is_policy_balloted_in_zone(zone_id, policy)

Determine if a Policy is currently balloted in a Zone.

Parameters:
  • zone_id (int) – The identifier of the Zone to check.

  • policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently balloted in a Zone. False, if not.

Return type:

bool

classmethod is_policy_enacted_in_current_zone(policy)

Determine if a Policy is currently enacted in the current Zone.

Parameters:

policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently enacted in the current Zone. False, if not.

Return type:

bool

classmethod is_policy_enacted_in_zone(zone_id, policy)

Determine if a Policy is currently enacted in a Zone.

Parameters:
  • zone_id (int) – The identifier of the Zone to check.

  • policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently enacted in a Zone. False, if not.

Return type:

bool

classmethod is_policy_in_current_zone(policy, policy_status)

Determine if a Policy has a specific Status in the current Zone.

Parameters:
  • policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

  • policy_status (CommonCivicPolicyStatusType) – The status of the policies to check.

Returns:

True, if the specified policy has the specified status in the current Zone. False, if not.

Return type:

bool

classmethod is_policy_in_zone(zone_id, policy, policy_status)

is_policy_in_current_zone(zone_id, policy, policy_status)

Determine if a Policy has a specific Status in a Zone.

Parameters:
  • zone_id (int) – The identifier of the Zone to check.

  • policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

  • policy_status (CommonCivicPolicyStatusType) – The status of the policies to check.

Returns:

True, if the specified policy has the specified status in a Zone. False, if not.

Return type:

bool

classmethod is_policy_up_for_repeal_in_current_zone(policy)

is_up_for_repeal_in_current_zone(policy)

Determine if a Policy is currently up for repeal in the current Zone.

Parameters:

policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently up for repeal in the current Zone. False, if not.

Return type:

bool

classmethod is_policy_up_for_repeal_in_zone(zone_id, policy)

is_up_for_repeal_in_zone(zone_id, policy)

Determine if a Policy is currently up for repeal in a Zone.

Parameters:
  • zone_id (int) – The identifier of the Zone to check.

  • policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The policy to look for.

Returns:

True, if the specified policy is currently up for repeal in a Zone. False, if not.

Return type:

bool

classmethod load_civic_policy_by_id(policy)

Load an instance of a Civic Policy by its identifier.

Parameters:

policy (Union[int, CommonVenueCivicPolicyId, CommonStreetCivicPolicyId, BaseCivicPolicy]) – The identifier of a Civic Policy.

Returns:

An instance of a Civic Policy matching the decimal identifier or None if not found.

Return type:

Union[BaseCivicPolicy, None]

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_lightning_level()

Retrieve the current lightning level.

Returns:

The current lightning level.

Return type:

int

classmethod get_current_precipitation_level(precipitation_type)

Retrieve the current precipitation level.

Parameters:

precipitation_type (PrecipitationType) – The type of precipitation to get.

Returns:

The current precipitation level.

Return type:

int

classmethod get_current_temperature()

Retrieve the current temperature.

Returns:

The current temperature.

Return type:

CommonTemperature

classmethod get_current_wind_speed()

Retrieve the current wind speed.

Returns:

The current speed of the wind.

Return type:

int

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.

Return type:

None

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