commlib.message
クラス RCRSCSMessageConverter

java.lang.Object
  上位を拡張 commlib.message.RCRSCSMessageConverter

public class RCRSCSMessageConverter
extends java.lang.Object

The RCRSCSMessageConverter convert messages to bytes, and bytes to messages.

作成者:
takefumi

フィールドの概要
 int DAMAGE_PERCEPTION_LOS
           
 int EXTINGUISHABLE_DISTANCE
           
 int EXTINGUISHABLE_POWER
           
 int HP_PERCEPTION_LOS
           
 int RANGE_OF_VIEW
           
 int TANK_MAX
           
 
コンストラクタの概要
RCRSCSMessageConverter(rescuecore2.worldmodel.EntityID ownerID, rescuecore2.config.Config config, java.util.List<rescuecore2.worldmodel.EntityID> buildingList, java.util.List<rescuecore2.worldmodel.EntityID> roadList, java.util.List<rescuecore2.worldmodel.EntityID> refugeList, java.util.List<rescuecore2.worldmodel.EntityID> areaList, java.util.List<rescuecore2.worldmodel.EntityID> policeForceList, java.util.List<rescuecore2.worldmodel.EntityID> ambulanceTeamList, java.util.List<rescuecore2.worldmodel.EntityID> fireBrigadeList, java.util.List<rescuecore2.worldmodel.EntityID> platoonAgentList, java.util.List<rescuecore2.worldmodel.EntityID> policeOfficeList, java.util.List<rescuecore2.worldmodel.EntityID> ambulanceCenterList, java.util.List<rescuecore2.worldmodel.EntityID> fireStationList)
          推奨されていません。 
RCRSCSMessageConverter(rescuecore2.worldmodel.EntityID ownerID, rescuecore2.standard.entities.StandardWorldModel model, rescuecore2.config.Config config)
          Constructor Prepare to convert.
 
メソッドの概要
static int bitToInt(java.util.List<java.lang.Integer> list, int index, int length)
          Create int from a part of bit sequence.
 java.util.List<RCRSCSMessage> bytesToMessageList(byte[] bytes)
          Convert received bytes to message list.
 boolean equals(java.lang.Object obj)
           
static int getDataTypeIndex(java.util.EnumMap<DataType,java.lang.Integer> map, DataType dType, java.lang.Integer i)
          This is private method used on converting.
 int hashCode()
           
 byte[] messageToBytes(java.util.List<RCRSCSMessage> messages)
          Convert messages to bytes
The messages that failed to cenvert are not contained.
 
クラス java.lang.Object から継承されたメソッド
getClass, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

EXTINGUISHABLE_POWER

public final int EXTINGUISHABLE_POWER

EXTINGUISHABLE_DISTANCE

public final int EXTINGUISHABLE_DISTANCE

TANK_MAX

public final int TANK_MAX

HP_PERCEPTION_LOS

public final int HP_PERCEPTION_LOS

DAMAGE_PERCEPTION_LOS

public final int DAMAGE_PERCEPTION_LOS

RANGE_OF_VIEW

public final int RANGE_OF_VIEW
コンストラクタの詳細

RCRSCSMessageConverter

@Deprecated
public RCRSCSMessageConverter(rescuecore2.worldmodel.EntityID ownerID,
                                         rescuecore2.config.Config config,
                                         java.util.List<rescuecore2.worldmodel.EntityID> buildingList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> roadList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> refugeList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> areaList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> policeForceList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> ambulanceTeamList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> fireBrigadeList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> platoonAgentList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> policeOfficeList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> ambulanceCenterList,
                                         java.util.List<rescuecore2.worldmodel.EntityID> fireStationList)
推奨されていません。 


RCRSCSMessageConverter

public RCRSCSMessageConverter(rescuecore2.worldmodel.EntityID ownerID,
                              rescuecore2.standard.entities.StandardWorldModel model,
                              rescuecore2.config.Config config)

Constructor

Prepare to convert.

パラメータ:
ownerID - EntityID of this converter user(Agent or Center).
model -
config -
メソッドの詳細

bytesToMessageList

public java.util.List<RCRSCSMessage> bytesToMessageList(byte[] bytes)
Convert received bytes to message list.
In case failure happen halfway through converting, return list of message converted by then.

パラメータ:
bytes - converting bytes
戻り値:
message list

bitToInt

public static int bitToInt(java.util.List<java.lang.Integer> list,
                           int index,
                           int length)
Create int from a part of bit sequence.

パラメータ:
list -
index -
length -
戻り値:
int

messageToBytes

public byte[] messageToBytes(java.util.List<RCRSCSMessage> messages)
Convert messages to bytes
The messages that failed to cenvert are not contained.

パラメータ:
messages - List of messages
戻り値:
transmitted byte sequence

getDataTypeIndex

public static int getDataTypeIndex(java.util.EnumMap<DataType,java.lang.Integer> map,
                                   DataType dType,
                                   java.lang.Integer i)
This is private method used on converting.

パラメータ:
map -
dType -
i -
戻り値:

hashCode

public int hashCode()
オーバーライド:
クラス java.lang.Object 内の hashCode

equals

public boolean equals(java.lang.Object obj)
オーバーライド:
クラス java.lang.Object 内の equals