de.uni_paderborn.robots.robotArenaInterface.proxy
Class ProxyCodes

java.lang.Object
  |
  +--de.uni_paderborn.robots.robotArenaInterface.proxy.ProxyCodes

public class ProxyCodes
extends java.lang.Object

This class provides methods for encoding and decoding actions, cards, and fields.

See Also:
Proxy, ProxyFactory, RobotFunctions

Field Summary
static byte ACTION_EXCHANGE
          Represents the action ExchangeAction.
static byte ACTION_MOVE
          Represents the action MoveAction.
static byte ACTION_NO
          Represents the action NoAction.
static byte ACTION_NONE
          Represents the action null.
static byte ACTION_PICK_UP
          Represents the action PickUpAction.
static byte ACTION_PUT
          Represents the action PutAction.
static byte ACTION_ROTATE
          Represents the action RotateAction.
static byte FIELD_EXIT
          Represents the field Exit.
static byte FIELD_NONE
          Represents the field null.
static byte FIELD_RECHARGER
          Represents the field Recharger.
static byte FIELD_VIRTUAL_ROBOT
          Represents the field VirtualRobot.
static byte FIELD_WALL
          Represents the field Wall.
static byte FIELD_WORMHOLE
          Represents the field Wormhole.
 
Constructor Summary
ProxyCodes()
           
 
Method Summary
static AbstractRobotAction decodeAction(byte action, int parameter)
          Decodes a robot action.
static CardData decodeCard(byte card)
          Decodes a card.
static ItemData decodeField(byte field, int parameter)
          Decodes a field.
static byte encodeAction(AbstractRobotAction action)
          Encodes a robot action.
static int encodeActionParameter(AbstractRobotAction action)
          Encodes the parameter (it is exists) of a robot action.
static byte encodeCard(CardData card)
          Encodes a card.
static byte encodeField(ItemData field)
          Encodes a field.
static int encodeFieldParameter(ItemData field)
          Encodes the parameter (it is exists) of a field.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ACTION_NONE

public static final byte ACTION_NONE
Represents the action null.

ACTION_NO

public static final byte ACTION_NO
Represents the action NoAction.

ACTION_MOVE

public static final byte ACTION_MOVE
Represents the action MoveAction.

ACTION_ROTATE

public static final byte ACTION_ROTATE
Represents the action RotateAction.

ACTION_PICK_UP

public static final byte ACTION_PICK_UP
Represents the action PickUpAction.

ACTION_PUT

public static final byte ACTION_PUT
Represents the action PutAction.

ACTION_EXCHANGE

public static final byte ACTION_EXCHANGE
Represents the action ExchangeAction.

FIELD_NONE

public static final byte FIELD_NONE
Represents the field null.

FIELD_WALL

public static final byte FIELD_WALL
Represents the field Wall.

FIELD_RECHARGER

public static final byte FIELD_RECHARGER
Represents the field Recharger.

FIELD_WORMHOLE

public static final byte FIELD_WORMHOLE
Represents the field Wormhole.

FIELD_VIRTUAL_ROBOT

public static final byte FIELD_VIRTUAL_ROBOT
Represents the field VirtualRobot.

FIELD_EXIT

public static final byte FIELD_EXIT
Represents the field Exit.
Constructor Detail

ProxyCodes

public ProxyCodes()
Method Detail

encodeAction

public static byte encodeAction(AbstractRobotAction action)
Encodes a robot action.
Parameters:
action - the action to encode
Returns:
the representation of this action

encodeActionParameter

public static int encodeActionParameter(AbstractRobotAction action)
Encodes the parameter (it is exists) of a robot action.
Parameters:
action - the action which the parameter to encode of
Returns:
the representation of the parameter of this action

decodeAction

public static AbstractRobotAction decodeAction(byte action,
                                               int parameter)
Decodes a robot action.
Parameters:
action - the represenation of the action
parameter - the parameter of the action
Returns:
an action matching the requirements

encodeCard

public static byte encodeCard(CardData card)
Encodes a card.
Parameters:
card - the card to encode
Returns:
the representation of this card

decodeCard

public static CardData decodeCard(byte card)
Decodes a card.
Parameters:
card - the represenation of the card
Returns:
a card matching the requirements

encodeField

public static byte encodeField(ItemData field)
Encodes a field.
Parameters:
field - the field to encode
Returns:
the representation of this field

encodeFieldParameter

public static int encodeFieldParameter(ItemData field)
Encodes the parameter (it is exists) of a field.
Parameters:
field - the field which the parameter to encode of
Returns:
the representation of the parameter of this field

decodeField

public static ItemData decodeField(byte field,
                                   int parameter)
Decodes a field.
Parameters:
field - the represenation of the field
parameter - the parameter of the field
Returns:
a field matching the requirements