|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectplanty.Weather
public class Weather
Implements weather behaviours and bonuses.
| Field Summary | |
|---|---|
private static int |
autumn
Represents Autumn. |
private static java.lang.String[] |
COLD_WEATHERS
The cold weather (climatological status on cold temperatures) names. |
private java.util.Random |
rnd
Pseudorandom number generator. |
private static int |
spring
Represents Spring. |
private static int |
summer
Represents Summer. |
static int |
TEMP_COLD
Represents the Cold temperature. |
static int |
TEMP_FREEZING
Represents the Freezing temperature. |
static int |
TEMP_FRYING
Represents the Frying temperature. |
static int |
TEMP_MILD
Represents the Mild temperature. |
static int |
TEMP_WARM
Represents the Warm temperature. |
private int |
temperature
The current temperature. |
private static java.lang.String[] |
TEMPERATURES
The temperatures names. |
private static java.lang.String[] |
WARM_WEATHERS
The warm and mild weather (climatological status on warm and mild temperatures) names. |
private int |
weather
The current weather status. |
static int |
WEATHER_DESERTIC
Represents the Desertic weather (clear extremily low relative humidity day). |
static int |
WEATHER_DRY
Represents the Dry weather (clear low relative humidity day). |
static int |
WEATHER_HUMID
Represents the Humid weather (cloudy day). |
static int |
WEATHER_NORMAL
Represents the Normal weather (clear day). |
static int |
WEATHER_X_HUMID
Represents the Highly Humid weather (either snow or rain). |
static int |
WEATHER_XX_HUMID
Represents the Hyper Humid weather (either heavy snow or storm). |
private static int |
winter
Represents Winter. |
| Constructor Summary | |
|---|---|
Weather()
Constructor method. |
|
Weather(boolean startMild)
Constructor method. |
|
| Method Summary | |
|---|---|
int |
getTemperature()
Does what you'd expect it to. |
java.lang.String |
getTemperatureName()
Does what you'd expect it to. |
int |
getWeather()
Does what you'd expect it to. |
java.lang.String |
getWeatherName()
Does what you'd expect it to. |
void |
newDay()
Deprecated. Due to the excessive randomicity of the resulting climates. Use newDay(temperature, weather) instead. |
void |
newDay(int season)
Rerandomizes the wheather accordingly to the season. |
void |
newDay(int temperature,
int weather)
Sets the weather to the given values; |
void |
setTemperature(int newTemperature)
Sets the current temperature to the given one. |
void |
setWeather(int newWeather)
Sets the current weather to the given status. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String[] COLD_WEATHERS
private static final java.lang.String[] WARM_WEATHERS
private static final java.lang.String[] TEMPERATURES
public static final int WEATHER_XX_HUMID
public static final int WEATHER_X_HUMID
public static final int WEATHER_HUMID
public static final int WEATHER_NORMAL
public static final int WEATHER_DRY
public static final int WEATHER_DESERTIC
public static final int TEMP_FREEZING
public static final int TEMP_COLD
public static final int TEMP_MILD
public static final int TEMP_WARM
public static final int TEMP_FRYING
private static final int spring
private static final int summer
private static final int autumn
private static final int winter
private java.util.Random rnd
private int weather
private int temperature
| Constructor Detail |
|---|
public Weather()
public Weather(boolean startMild)
startMild - whether or not the weather should be initialized with a mild set.| Method Detail |
|---|
public int getWeather()
public java.lang.String getWeatherName()
public int getTemperature()
public java.lang.String getTemperatureName()
public void setWeather(int newWeather)
newWeather - the new weather, spaning from 0 (Hyper Humid) to 5 (Desertic).public void setTemperature(int newTemperature)
newTemperature - the new temperature, spaning from 0 (Freezing) to 4 (Frying).public void newDay()
newDay(temperature, weather) instead.
public void newDay(int temperature,
int weather)
temperature - the new temperature, at least 0 (Freezing), at most 4 (Frying).weather - the new weather, at least 0 (Hyper Humid), at most 5 (Desertic).public void newDay(int season)
season - the season id, ranging from 0 (Spring) to 3 (Winter).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||