|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.planet_ink.coffee_mud.Common.DefaultClimate
public class DefaultClimate
Field Summary | |
---|---|
protected static int[] |
changeMap
|
protected static int[] |
cold
|
protected int |
currentWeather
|
protected static int[] |
dry
|
protected static int[] |
hot
|
protected int |
nextWeather
|
protected static int[] |
seasonalWeather
|
protected int |
tickStatus
|
protected int |
weatherTicker
|
protected static int[] |
wet
|
protected static int[] |
windy
|
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Climate |
---|
NUM_WEATHER, WEATHER_BLIZZARD, WEATHER_CLEAR, WEATHER_CLOUDY, WEATHER_DESCS, WEATHER_DROUGHT, WEATHER_DUSTSTORM, WEATHER_HAIL, WEATHER_HEAT_WAVE, WEATHER_RAIN, WEATHER_SLEET, WEATHER_SNOW, WEATHER_THUNDERSTORM, WEATHER_TICK_DOWN, WEATHER_WINDY, WEATHER_WINTER_COLD |
Constructor Summary | |
---|---|
DefaultClimate()
|
Method Summary | |
---|---|
int[] |
addMaskAndReturn(int[] one,
int[] two)
|
int |
adjustMovement(int base,
Room room)
If applicable, thies method will return the base movement cost of the given mob, modified up or down based on the room given. |
int |
adjustWaterConsumption(int base,
Room room)
If applicable, thies method will return the base water thirstiness of the given mob, modified up or down based on the room given. |
boolean |
canSeeTheMoon(Room room,
Ability butNotA)
Returns whether a player can see the moon from the current room. |
boolean |
canSeeTheStars(Room room)
Returns whether a player can see the stars from the current room. |
boolean |
canSeeTheSun(Room room)
Returns whether a player can see the sun from the current room. |
int |
compareTo(CMObject o)
|
CMObject |
copyOf()
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed. |
void |
forceWeatherTick(Area A)
This method forces the weather to change to what is designated by the nextWeatherType(). |
java.lang.String |
getNextWeatherDescription(Area A)
Returns a readable string describing the upcoming weather conditions in the given area, assuming this climate is the correct one. |
int |
getTickStatus()
A coded status for this object during the period where its tick method is being called. |
java.lang.String |
getWeatherDescription(Area A)
Returns a readable string describing the weather conditions in the given area, assuming this climate is the correct one. |
protected java.lang.String |
getWeatherStop(int weatherCode)
|
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in during initialization. |
java.lang.String |
name()
The nice displayable name of this instance of this object |
CMObject |
newInstance()
Returns a new instance of this class. |
java.lang.String |
nextWeatherDescription(Room room)
Returns a readable description of the weather that will be upcoming for the given room. |
int |
nextWeatherType(Room room)
Returns the upcoming specific weather situation for the given room. |
protected void |
sayToEveryoneInArea(Area A,
int oldWeather,
java.lang.String say)
|
void |
setCurrentWeatherType(int weatherCode)
Sets the current specific weather situation for this area. |
void |
setNextWeatherType(int weatherCode)
Sets the upcoming specific weather situation for this area. |
protected java.lang.String |
theWeatherDescription(Area A,
int weather)
|
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
java.lang.String |
weatherDescription(Room room)
Returns a readable description of the weather for the given room. |
void |
weatherTick(Area A)
|
int |
weatherType(Room room)
Returns the specific weather situation for the given room. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int tickStatus
protected int currentWeather
protected int nextWeather
protected int weatherTicker
protected static final int[] seasonalWeather
protected static final int[] cold
protected static final int[] hot
protected static final int[] dry
protected static final int[] wet
protected static final int[] windy
protected static final int[] changeMap
Constructor Detail |
---|
public DefaultClimate()
Method Detail |
---|
public java.lang.String ID()
CMObject
ID
in interface CMObject
public java.lang.String name()
Tickable
name
in interface CMObject
name
in interface Tickable
Environmental.Name()
public int getTickStatus()
Tickable
getTickStatus
in interface Tickable
Tickable.tick(Tickable, int)
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public CMObject copyOf()
CMObject
copyOf
in interface CMObject
public int nextWeatherType(Room room)
Climate
nextWeatherType
in interface Climate
room
- the room to evaluate.
Climate
,
Climate.setNextWeatherType(int)
public java.lang.String nextWeatherDescription(Room room)
Climate
nextWeatherDescription
in interface Climate
room
- the room to evaluate
public java.lang.String getNextWeatherDescription(Area A)
Climate
getNextWeatherDescription
in interface Climate
A
- the area to evaluate
public void setNextWeatherType(int weatherCode)
Climate
setNextWeatherType
in interface Climate
weatherCode
- the Climate.WEATHER_* constantClimate
,
Climate.nextWeatherType(Room)
public void setCurrentWeatherType(int weatherCode)
Climate
setCurrentWeatherType
in interface Climate
weatherCode
- the Climate.WEATHER_* constantClimate
,
Climate.weatherType(Room)
public int weatherType(Room room)
Climate
weatherType
in interface Climate
room
- the room to evaluate.
Climate
,
Climate.setCurrentWeatherType(int)
public java.lang.String weatherDescription(Room room)
Climate
weatherDescription
in interface Climate
room
- the room to evaluate
public boolean canSeeTheMoon(Room room, Ability butNotA)
Climate
canSeeTheMoon
in interface Climate
room
- the room vantage pointbutNotA
- an ability to exempt from moon flags
public boolean canSeeTheStars(Room room)
Climate
canSeeTheStars
in interface Climate
room
- the room vantage point
public boolean canSeeTheSun(Room room)
Climate
canSeeTheSun
in interface Climate
room
- the room vantage point
protected java.lang.String getWeatherStop(int weatherCode)
public void forceWeatherTick(Area A)
Climate
forceWeatherTick
in interface Climate
A
- the area to calculate next weather for.public int[] addMaskAndReturn(int[] one, int[] two)
protected void sayToEveryoneInArea(Area A, int oldWeather, java.lang.String say)
public void weatherTick(Area A)
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in Tickable
Tickable
,
ServiceEngine
,
TickableGroup
protected java.lang.String theWeatherDescription(Area A, int weather)
public java.lang.String getWeatherDescription(Area A)
Climate
getWeatherDescription
in interface Climate
A
- the area to evaluate
public int adjustWaterConsumption(int base, Room room)
Climate
adjustWaterConsumption
in interface Climate
base
- the water thirst gain to start withroom
- the room the mob is in
public int adjustMovement(int base, Room room)
Climate
adjustMovement
in interface Climate
base
- the movement loss to start withroom
- the room the mob is moving through
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |