|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrescuecore.Command
This class encapsulates a command to the server.
RescueConstants.AK_CONNECT
,
RescueConstants.AK_MOVE
,
RescueConstants.AK_SAY
,
RescueConstants.AK_TELL
,
RescueConstants.AK_EXTINGUISH
,
RescueConstants.AK_CLEAR
,
RescueConstants.AK_RESCUE
,
RescueConstants.AK_LOAD
,
RescueConstants.AK_UNLOAD
,
RescueConstants.AK_REST
,
RescueConstants.COMMAND_CONNECT
,
RescueConstants.COMMAND_ACKNOWLEDGE
,
RescueConstants.COMMAND_MOVE
,
RescueConstants.COMMAND_SAY
,
RescueConstants.COMMAND_TELL
,
RescueConstants.COMMAND_EXTINGUISH
,
RescueConstants.COMMAND_CLEAR
,
RescueConstants.COMMAND_RESCUE
,
RescueConstants.COMMAND_LOAD
,
RescueConstants.COMMAND_UNLOAD
,
RescueConstants.COMMAND_REST
Field Summary |
Constructor Summary | |
Command(int type,
byte[] data)
Construct a new Command |
Method Summary | |
static Command |
AK_ACKNOWLEDGE(int id)
Create an AK_ACKNOWLEDGE message |
static Command |
AK_CLEAR(int id,
int target)
Create an AK_CLEAR message |
static Command |
AK_CONNECT(int tempID,
int type,
int version)
Create an AK_CONNECT message |
static Command |
AK_EXTINGUISH(int agentID,
int targetID)
Create an AK_EXTINGUISH message that will use the maximum extinguish power and ignore the direction,x and y parameters |
static Command |
AK_EXTINGUISH(int agentID,
int targetID,
int direction,
int x,
int y)
Create an AK_EXTINGUISH message that will use the maximum extinguish power |
static Command |
AK_EXTINGUISH(int agentID,
int targetID,
int direction,
int x,
int y,
int water)
Create an AK_EXTINGUISH message |
static Command |
AK_LOAD(int id,
int target)
Create an AK_LOAD message |
static Command |
AK_MOVE(int id,
int[] path)
Create an AK_MOVE message |
static Command |
AK_RESCUE(int id,
int target)
Create an AK_RESCUE message |
static Command |
AK_SAY(int id,
byte[] msg)
Create an AK_SAY message |
static Command |
AK_TELL(int id,
byte[] msg)
Create an AK_TELL message |
static Command |
AK_UNLOAD(int id)
Create an AK_UNLOAD message |
byte[] |
getData()
Get the data of this command |
java.io.DataInput |
getDataInput()
Get the data of this command as a DataInput |
int |
getKernelType()
Get the type of this command, as the rescue simulation kernel sees it |
int |
getType()
Get the type of this command |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Command(int type, byte[] data)
type
- The type of this commanddata
- The command-dependant data to be sent to the kernalRescueConstants.COMMAND_CONNECT
,
RescueConstants.COMMAND_ACKNOWLEDGE
,
RescueConstants.COMMAND_MOVE
,
RescueConstants.COMMAND_SAY
,
RescueConstants.COMMAND_TELL
,
RescueConstants.COMMAND_EXTINGUISH
,
RescueConstants.COMMAND_CLEAR
,
RescueConstants.COMMAND_RESCUE
,
RescueConstants.COMMAND_LOAD
,
RescueConstants.COMMAND_UNLOAD
,
RescueConstants.COMMAND_REST
Method Detail |
public int getType()
RescueConstants.COMMAND_CONNECT
,
RescueConstants.COMMAND_ACKNOWLEDGE
,
RescueConstants.COMMAND_MOVE
,
RescueConstants.COMMAND_SAY
,
RescueConstants.COMMAND_TELL
,
RescueConstants.COMMAND_EXTINGUISH
,
RescueConstants.COMMAND_CLEAR
,
RescueConstants.COMMAND_RESCUE
,
RescueConstants.COMMAND_LOAD
,
RescueConstants.COMMAND_UNLOAD
,
RescueConstants.COMMAND_REST
public int getKernelType()
RescueConstants.AK_CONNECT
,
RescueConstants.AK_MOVE
,
RescueConstants.AK_SAY
,
RescueConstants.AK_TELL
,
RescueConstants.AK_EXTINGUISH
,
RescueConstants.AK_CLEAR
,
RescueConstants.AK_RESCUE
,
RescueConstants.AK_LOAD
,
RescueConstants.AK_UNLOAD
,
RescueConstants.AK_REST
public byte[] getData()
public java.io.DataInput getDataInput()
public java.lang.String toString()
public static Command AK_CONNECT(int tempID, int type, int version)
tempID
- The temporary ID for the connecting agenttype
- The type of agent connecting. Should be the logical OR of one or more of AGENT_TYPE_CIVILIAN, AGENT_TYPE_FIRE_BRIGADE, AGENT_TYPE_FIRE_STATION, AGENT_TYPE_AMBULANCE_TEAM, AGENT_TYPE_AMBULANCE_CENTER, AGENT_TYPE_POLICE_FORCE, AGENT_TYPE_POLICE_STATIONversion
- The version number to send. Should be zero, but can use 1 if we are using shared memory
public static Command AK_ACKNOWLEDGE(int id)
id
- The id of the agent sending the acknowledgement
public static Command AK_EXTINGUISH(int agentID, int targetID)
agentID
- The id of the agent sending the extinguish commandtargetID
- The id of the burning building
public static Command AK_EXTINGUISH(int agentID, int targetID, int direction, int x, int y)
agentID
- The id of the agent sending the extinguish commandtargetID
- The id of the burning buildingdirection
- The direction from the nozzle to the buildingx
- The x coordinate of the nozzley
- The y coordinate of the nozzle
public static Command AK_EXTINGUISH(int agentID, int targetID, int direction, int x, int y, int water)
agentID
- The id of the agent sending the extinguish commandtargetID
- The id of the burning buildingdirection
- The direction from the nozzle to the buildingx
- The x coordinate of the nozzley
- The y coordinate of the nozzlewater
- The amount of water to extinguish with, in 1/1000 m^3/min
public static Command AK_CLEAR(int id, int target)
id
- The id of the agent sending the clear commandtarget
- The id of the road to be cleared
public static Command AK_RESCUE(int id, int target)
id
- The id of the agent sending the rescue commandtarget
- The id of the civilian to be rescued
public static Command AK_LOAD(int id, int target)
id
- The id of the agent sending the load commandtarget
- The id of the civilian to be loaded
public static Command AK_UNLOAD(int id)
id
- The id of the agent sending the unload command
public static Command AK_MOVE(int id, int[] path)
id
- The id of the agent sending the move commandpath
- A list of ids (nodes, roads, rivers, rivernodes, buildings) the describe the path
public static Command AK_SAY(int id, byte[] msg)
id
- The id of the agent saying somethingmsg
- The message
public static Command AK_TELL(int id, byte[] msg)
id
- The id of the agent saying somethingmsg
- The message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |