|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrescuecore.Property
This class encapsulates information about an individual property within a RescueObject
| Field Summary |
| Method Summary | |
boolean |
decode(java.io.DataInput in,
int timestamp)
Decode an update from the kernel. |
boolean |
getBooleanValue()
Get the value of this property as a boolean. |
int[] |
getIntArrayValue()
Get the value of this property as an integer array. |
int |
getIntValue()
Get the value of this property as an integer. |
int |
getLastUpdate()
Get the last time this property was updated |
int |
getPropertyType()
Get the type of this property |
java.lang.String |
getStringValue()
Get the value of this property as a string |
int |
getValueType()
Get the data type of this property |
boolean |
isOlderThan(int time)
Find out whether this property was last updated before a certain time |
boolean |
isValueKnown()
Find out whether the value of this property is known or assumed |
static Property |
make(int property)
Generate a new Property of a particular type |
boolean |
setValue(boolean value,
int timestamp)
Set the boolean value of this property. |
boolean |
setValue(int[] value,
int timestamp)
Set the integer array value of this property. |
boolean |
setValue(int value,
int timestamp)
Set the integer value of this property. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public static Property make(int property)
throws UnknownPropertyException
property - The property we are interested in
UnknownPropertyException - if 'property' is not recognisedRescueConstants.PROPERTY_START_TIME,
RescueConstants.PROPERTY_LONGITUDE,
RescueConstants.PROPERTY_LATITUDE,
RescueConstants.PROPERTY_WIND_FORCE,
RescueConstants.PROPERTY_WIND_DIRECTION,
RescueConstants.PROPERTY_X,
RescueConstants.PROPERTY_Y,
RescueConstants.PROPERTY_DIRECTION,
RescueConstants.PROPERTY_POSITION,
RescueConstants.PROPERTY_POSITION_EXTRA,
RescueConstants.PROPERTY_STAMINA,
RescueConstants.PROPERTY_HP,
RescueConstants.PROPERTY_DAMAGE,
RescueConstants.PROPERTY_BURIEDNESS,
RescueConstants.PROPERTY_FLOORS,
RescueConstants.PROPERTY_BUILDING_ATTRIBUTES,
RescueConstants.PROPERTY_BROKENNESS,
RescueConstants.PROPERTY_FIERYNESS,
RescueConstants.PROPERTY_BUILDING_SHAPE_ID,
RescueConstants.PROPERTY_BUILDING_CODE,
RescueConstants.PROPERTY_BUILDING_AREA_GROUND,
RescueConstants.PROPERTY_BUILDING_AREA_TOTAL,
RescueConstants.PROPERTY_WATER_QUANTITY,
RescueConstants.PROPERTY_STRETCHED_LENGTH,
RescueConstants.PROPERTY_HEAD,
RescueConstants.PROPERTY_TAIL,
RescueConstants.PROPERTY_LENGTH,
RescueConstants.PROPERTY_ROAD_KIND,
RescueConstants.PROPERTY_CARS_PASS_TO_HEAD,
RescueConstants.PROPERTY_CARS_PASS_TO_TAIL,
RescueConstants.PROPERTY_HUMANS_PASS_TO_HEAD,
RescueConstants.PROPERTY_HUMANS_PASS_TO_TAIL,
RescueConstants.PROPERTY_WIDTH,
RescueConstants.PROPERTY_BLOCK,
RescueConstants.PROPERTY_REPAIR_COST,
RescueConstants.PROPERTY_LINES_TO_HEAD,
RescueConstants.PROPERTY_LINES_TO_TAIL,
RescueConstants.PROPERTY_WIDTH_FOR_WALKERS,
RescueConstants.PROPERTY_IGNITION,
RescueConstants.PROPERTY_MEDIAN_STRIP,
RescueConstants.PROPERTY_SIGNAL,
RescueConstants.PROPERTY_SHORTCUT_TO_TURN,
RescueConstants.PROPERTY_POCKET_TO_TURN_ACROSS,
RescueConstants.PROPERTY_POSITION_HISTORY,
RescueConstants.PROPERTY_ENTRANCES,
RescueConstants.PROPERTY_BUILDING_APEXES,
RescueConstants.PROPERTY_EDGES,
RescueConstants.PROPERTY_SIGNAL_TIMINGpublic int getPropertyType()
RescueConstants.PROPERTY_START_TIME,
RescueConstants.PROPERTY_LONGITUDE,
RescueConstants.PROPERTY_LATITUDE,
RescueConstants.PROPERTY_WIND_FORCE,
RescueConstants.PROPERTY_WIND_DIRECTION,
RescueConstants.PROPERTY_X,
RescueConstants.PROPERTY_Y,
RescueConstants.PROPERTY_DIRECTION,
RescueConstants.PROPERTY_POSITION,
RescueConstants.PROPERTY_POSITION_EXTRA,
RescueConstants.PROPERTY_STAMINA,
RescueConstants.PROPERTY_HP,
RescueConstants.PROPERTY_DAMAGE,
RescueConstants.PROPERTY_BURIEDNESS,
RescueConstants.PROPERTY_FLOORS,
RescueConstants.PROPERTY_BUILDING_ATTRIBUTES,
RescueConstants.PROPERTY_BROKENNESS,
RescueConstants.PROPERTY_FIERYNESS,
RescueConstants.PROPERTY_BUILDING_SHAPE_ID,
RescueConstants.PROPERTY_BUILDING_CODE,
RescueConstants.PROPERTY_BUILDING_AREA_GROUND,
RescueConstants.PROPERTY_BUILDING_AREA_TOTAL,
RescueConstants.PROPERTY_WATER_QUANTITY,
RescueConstants.PROPERTY_STRETCHED_LENGTH,
RescueConstants.PROPERTY_HEAD,
RescueConstants.PROPERTY_TAIL,
RescueConstants.PROPERTY_LENGTH,
RescueConstants.PROPERTY_ROAD_KIND,
RescueConstants.PROPERTY_CARS_PASS_TO_HEAD,
RescueConstants.PROPERTY_CARS_PASS_TO_TAIL,
RescueConstants.PROPERTY_HUMANS_PASS_TO_HEAD,
RescueConstants.PROPERTY_HUMANS_PASS_TO_TAIL,
RescueConstants.PROPERTY_WIDTH,
RescueConstants.PROPERTY_BLOCK,
RescueConstants.PROPERTY_REPAIR_COST,
RescueConstants.PROPERTY_LINES_TO_HEAD,
RescueConstants.PROPERTY_LINES_TO_TAIL,
RescueConstants.PROPERTY_WIDTH_FOR_WALKERS,
RescueConstants.PROPERTY_IGNITION,
RescueConstants.PROPERTY_MEDIAN_STRIP,
RescueConstants.PROPERTY_SIGNAL,
RescueConstants.PROPERTY_SHORTCUT_TO_TURN,
RescueConstants.PROPERTY_POCKET_TO_TURN_ACROSS,
RescueConstants.PROPERTY_POSITION_HISTORY,
RescueConstants.PROPERTY_ENTRANCES,
RescueConstants.PROPERTY_BUILDING_APEXES,
RescueConstants.PROPERTY_EDGES,
RescueConstants.PROPERTY_SIGNAL_TIMINGpublic int getValueType()
RescueConstants.PROPERTY_TYPE_INT,
RescueConstants.PROPERTY_TYPE_INT_ARRAY,
RescueConstants.PROPERTY_TYPE_BOOLEANpublic int getLastUpdate()
public boolean isOlderThan(int time)
time - The time to check against
public boolean isValueKnown()
public int getIntValue()
getValueType()public int[] getIntArrayValue()
getValueType()public boolean getBooleanValue()
getValueType()public java.lang.String toString()
public java.lang.String getStringValue()
public boolean setValue(int value,
int timestamp)
value - The new valuetimestamp - The timestamp of this update
isOlderThan(int),
getValueType()
public boolean setValue(int[] value,
int timestamp)
value - The new valuetimestamp - The timestamp of this update
isOlderThan(int),
getValueType()
public boolean setValue(boolean value,
int timestamp)
value - The new valuetimestamp - The timestamp of this update
isOlderThan(int),
getValueType()
public boolean decode(java.io.DataInput in,
int timestamp)
throws java.io.IOException
in - A DataInput to read data fromtimestamp - The timestamp of this update
java.io.IOException - if something goes wrong
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||