Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jp.ac.nagoyau.is.ss.kishii.suntori.message
Class RCRSCSMessageConverter

    java.lang.Object
      jp.ac.nagoyau.is.ss.kishii.suntori.message.RCRSCSMessageConverter

    public class RCRSCSMessageConverter

extends java.lang.Object

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

Author:
  takefumi

Field Summary
`int` | `DAMAGE_PERCEPTION_LOS`
`int` | `EXTINGUISHABLE_DISTANCE`
`int` | `EXTINGUISHABLE_POWER`
`int` | `HP_PERCEPTION_LOS`
`int` | `RANGE_OF_VIEW`
`int` | `TANK_MAX`

Constructor Summary
`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)` Deprecated.
`RCRSCSMessageConverter(rescuecore2.worldmodel.EntityID ownerID, rescuecore2.standard.entities.StandardWorldModel model, rescuecore2.config.Config config)` Constructor

Method Summary
`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. In case failure happen halfway through converting, return list of message converted by then.
`static int` | `getDataTypeIndex(java.util.EnumMap<DataType,java.lang.Integer> map, DataType dType, java.lang.Integer i)` This is private method used on converting.
`byte[]` | `messageToBytes(java.util.List<RCRSCSMessage> messages)` Convert messages to bytes The messages that failed to cenvert are not contained.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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

Constructor Detail

### 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)

  Deprecated.

### RCRSCSMessageConverter

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

  ## Constructor

  Prepare to convert.

  Parameters:
    `ownerID` - EntityID of this converter user(Agent or Center).
    `model` -
    `config` -

Method Detail

### 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.

  Parameters:
    `bytes` - converting bytes
  Returns:
    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.

  Parameters:
    `list` -
    `index` -
    `length` -
  Returns:
    int

### messageToBytes

    public byte[] messageToBytes(java.util.List<RCRSCSMessage> messages)

  Convert messages to bytes
  The messages that failed to cenvert are not contained.

  Parameters:
    `messages` - List of messages
  Returns:
    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.

  Parameters:
    `map` -
    `dType` -
    `i` -
  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD