Package games.stendhal.server.core.rp
Class WeatherUpdater
java.lang.Object
games.stendhal.server.core.rp.WeatherUpdater
- All Implemented Interfaces:
TurnListener
Manager for zones with changing weather.
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
The keyword used by the weather adjustments parser. -
Method Summary
Modifier and TypeMethodDescriptionstatic WeatherUpdater
get()
Get the WeatherUpdater instance.void
manageAttributes(ZoneAttributes attr, String desc)
Make a zone weather managed by the weather updater.void
onTurnReached(int currentTurn)
This method is called when the turn number is reached.
-
Field Details
-
WEATHER_KEYWORD
The keyword used by the weather adjustments parser.- See Also:
- Constant Field Values
-
-
Method Details
-
get
Get the WeatherUpdater instance.- Returns:
- singleton instance
-
manageAttributes
Make a zone weather managed by the weather updater. Modifiers to the default weather can be described in form "varying(rain=value1, temperature=value2, fog=value3)", where any or all of the modifiers can be omitted, and their order does not matter. Description parameter "varying" is interpreted as "varying()", that is, no weather modifiers.
The values are interpreted so that:- One step of
rain
corresponds to adding about 5% to rain probability - One step of
temperature
corresponds roughly to one month of time difference (compared to coldest month). - One step of
fog
corresponds to adding about 5% to fog probability
If a modifier is specified more than once, the last one takes effect.- Parameters:
attr
- Attributes of the zonedesc
- The weather attribute value specified for the zone. This is used to determine any zone specific modifiers
- One step of
-
onTurnReached
public final void onTurnReached(int currentTurn)Description copied from interface:TurnListener
This method is called when the turn number is reached.- Specified by:
onTurnReached
in interfaceTurnListener
- Parameters:
currentTurn
- current turn number
-