// Copyright (C) 2002 Takeshi Morimoto <morimoto@takopen.cs.uec.ac.jp>
// All rights reserved.
package improvedYabAPI.io;

public interface ProtocolConstants {
  /** @see "<code>port</code> of the RUN/config.txt" */
  static final int UDP_KERNEL_LISTENING_PORT = 8000;

  /** @see "<code>send_udp_size</code> of the RUN/config.txt" */
  static final int UDP_PACKET_SIZE = 65536; //[byte]

  /** @see "<code>System::agentConnect()</code> of the kernel/System.cxx" */
  static final String REASON_OF_KA_CONNECT_ERROR2 = "Simulation has started";
  static final String REASON_OF_KA_CONNECT_ERROR = "No more agents";

  public final static int TYPE_NULL = 0;
  public final static int TYPE_WORLD = 0x01;
  public final static int TYPE_ROAD = 0x02;
  public final static int TYPE_RIVER = 0x03;
  public final static int TYPE_NODE = 0x04;
  public final static int TYPE_RIVER_NODE = 0x05;
  public final static int TYPE_BUILDING = 0x20;
  public final static int TYPE_REFUGE = 0x21;
  public final static int TYPE_FIRE_STATION = 0x22;
  public final static int TYPE_AMBULANCE_CENTER = 0x23;
  public final static int TYPE_POLICE_OFFICE = 0x24;
  public final static int TYPE_CIVILIAN = 0x40;
  public final static int TYPE_CAR = 0x41;
  public final static int TYPE_FIRE_BRIGADE = 0x42;
  public final static int TYPE_AMBULANCE_TEAM = 0x43;
  public final static int TYPE_POLICE_FORCE = 0x44;

  public final static int AGENT_TYPE_CIVILIAN = 0x01;
  public final static int AGENT_TYPE_FIRE_BRIGADE = 0x02;
  public final static int AGENT_TYPE_FIRE_STATION = 0x04;
  public final static int AGENT_TYPE_AMBULANCE_TEAM = 0x08;
  public final static int AGENT_TYPE_AMBULANCE_CENTER = 0x10;
  public final static int AGENT_TYPE_POLICE_FORCE = 0x20;
  public final static int AGENT_TYPE_POLICE_OFFICE = 0x40;
  public final static int AGENT_TYPE_ANY_MOBILE = AGENT_TYPE_FIRE_BRIGADE |
      AGENT_TYPE_AMBULANCE_TEAM | AGENT_TYPE_POLICE_FORCE;
  public final static int AGENT_TYPE_ANY_BUILDING = AGENT_TYPE_FIRE_STATION |
      AGENT_TYPE_AMBULANCE_CENTER | AGENT_TYPE_POLICE_OFFICE;
  public final static int AGENT_TYPE_ANY_AGENT = AGENT_TYPE_ANY_MOBILE |
      AGENT_TYPE_ANY_BUILDING;
  public final static int AGENT_TYPE_ANY = AGENT_TYPE_ANY_MOBILE |
      AGENT_TYPE_ANY_BUILDING | AGENT_TYPE_CIVILIAN;

  public final static int PROPERTY_NULL = 0;
  public final static int PROPERTY_MIN = 1;
  public final static int PROPERTY_START_TIME = 1;
  public final static int PROPERTY_LONGITUDE = 2;
  public final static int PROPERTY_LATITUDE = 3;
  public final static int PROPERTY_WIND_FORCE = 4;
  public final static int PROPERTY_WIND_DIRECTION = 5;

  public final static int PROPERTY_HEAD = 6;
  public final static int PROPERTY_TAIL = 7;
  public final static int PROPERTY_LENGTH = 8;

  public final static int PROPERTY_ROAD_KIND = 9;
  public final static int PROPERTY_CARS_PASS_TO_HEAD = 10;
  public final static int PROPERTY_CARS_PASS_TO_TAIL = 11;
  public final static int PROPERTY_HUMANS_PASS_TO_HEAD = 12;
  public final static int PROPERTY_HUMANS_PASS_TO_TAIL = 13;
  public final static int PROPERTY_WIDTH = 14;
  public final static int PROPERTY_BLOCK = 15;
  public final static int PROPERTY_REPAIR_COST = 16;
  public final static int PROPERTY_MEDIAN_STRIP = 17;
  public final static int PROPERTY_LINES_TO_HEAD = 18;
  public final static int PROPERTY_LINES_TO_TAIL = 19;
  public final static int PROPERTY_WIDTH_FOR_WALKERS = 20;
  public final static int PROPERTY_SIGNAL = 21;
  public final static int PROPERTY_SHORTCUT_TO_TURN = 22;
  public final static int PROPERTY_POCKET_TO_TURN_ACROSS = 23;
  public final static int PROPERTY_SIGNAL_TIMING = 24;

  public final static int PROPERTY_X = 25;
  public final static int PROPERTY_Y = 26;
  public final static int PROPERTY_EDGES = 27;

  public final static int PROPERTY_FLOORS = 28;
  public final static int PROPERTY_BUILDING_ATTRIBUTES = 29;
  public final static int PROPERTY_IGNITION = 30;
  public final static int PROPERTY_FIERYNESS = 31;
  public final static int PROPERTY_BROKENNESS = 32;
  public final static int PROPERTY_ENTRANCES = 33;
  public final static int PROPERTY_BUILDING_CODE = 34;
  public final static int PROPERTY_BUILDING_AREA_GROUND = 35;
  public final static int PROPERTY_BUILDING_AREA_TOTAL = 36;
  public final static int PROPERTY_BUILDING_APEXES = 37;

  public final static int PROPERTY_POSITION = 38;
  public final static int PROPERTY_POSITION_EXTRA = 39;
  public final static int PROPERTY_DIRECTION = 40;
  public final static int PROPERTY_POSITION_HISTORY = 41;
  public final static int PROPERTY_STAMINA = 42;
  public final static int PROPERTY_HP = 43;
  public final static int PROPERTY_DAMAGE = 44;
  public final static int PROPERTY_BURIEDNESS = 45;
  public final static int PROPERTY_WATER_QUANTITY = 46;

  public final static int PROPERTY_MAX = 46;

  public final static int HEADER_NULL = 0;

  public final static int KG_CONNECT = 0x10;
  public final static int KG_ACKNOWLEDGE = 0x11;
  public final static int GK_CONNECT_OK = 0x12;
  public final static int GK_CONNECT_ERROR = 0x13;

  public final static int SK_CONNECT = 0x20;
  public final static int SK_ACKNOWLEDGE = 0x21;
  public final static int SK_UPDATE = 0x22;
  public final static int KS_CONNECT_OK = 0x23;
  public final static int KS_CONNECT_ERROR = 0x24;

  public final static int VK_CONNECT = 0x30;
  public final static int VK_ACKNOWLEDGE = 0x31;
  public final static int KV_CONNECT_OK = 0x32;
  public final static int KV_CONNECT_ERROR = 0x33;

  public final static int AK_CONNECT = 0x40;
  public final static int AK_ACKNOWLEDGE = 0x41;
  public final static int KA_CONNECT_OK = 0x42;
  public final static int KA_CONNECT_ERROR = 0x43;
  public final static int KA_SENSE = 0x44;
  public final static int KA_HEAR = 0x45;
  public final static int KA_HEAR_SAY = 0x46;
  public final static int KA_HEAR_TELL = 0x47;

  public final static int UPDATE = 0x50;
  public final static int COMMANDS = 0x51;

  public final static int AK_REST = 0x80;
  public final static int AK_MOVE = 0x81;
  public final static int AK_LOAD = 0x82;
  public final static int AK_UNLOAD = 0x83;
  public final static int AK_SAY = 0x84;
  public final static int AK_TELL = 0x85;
  public final static int AK_EXTINGUISH = 0x86;

  //    public final static int AK_STRETCH = 0x87;
  public final static int AK_RESCUE = 0x88;
  public final static int AK_CLEAR = 0x89;

      /*static final int
          HEADER_NULL      = 0x00,
          AK_CONNECT       = 0x10,
          AK_ACKNOWLEDGE   = 0x11,
          AK_REST          = 0x80,
          AK_MOVE          = 0x81,
          AK_LOAD          = 0x82,
          AK_UNLOAD        = 0x83,
          AK_SAY           = 0x84,
          AK_TELL          = 0x85,
          AK_EXTINGUISH    = 0x86,
          AK_STRETCH       = 0x87,
          AK_RESCUE        = 0x88,
          AK_CLEAR         = 0x89,
          KA_CONNECT_OK    = 0x50,
          KA_CONNECT_ERROR = 0x51,
          KA_SENSE         = 0x52,
          KA_HEAR          = 0x53,
          KA_HEAR_SAY      = 0x54,
          KA_HEAR_TELL     = 0x55;

      static final int
          TYPE_NULL             = 0,
          TYPE_ROAD             = 168,
          TYPE_RIVER            = 169,
          TYPE_BUILDING         = 176,
          TYPE_REFUGE           = 184,
          TYPE_FIRE_STATION     = 185,
          TYPE_AMBULANCE_CENTER = 186,
          TYPE_POLICE_OFFICE    = 187,
          TYPE_RIVER_NODE       = 201,
          TYPE_NODE             = 200,
          TYPE_WORLD            = 208,
          TYPE_CIVILIAN         = 232,
          TYPE_FIRE_BRIGADE     = 233,
          TYPE_FIRE_COMPANY     = TYPE_FIRE_BRIGADE,
          TYPE_AMBULANCE_TEAM   = 234,
          TYPE_POLICE_FORCE     = 235,
          TYPE_CAR              = 236;

      static final int
          PROPERTY_NULL                  =   0,
          PROPERTY_WIDTH                 =  38,
          PROPERTY_BUILDING_AREA_TOTAL   =  52,
          PROPERTY_START_TIME            =  29,
          PROPERTY_SIGNAL_TIMING         = 130,
          PROPERTY_LINES_TO_HEAD         =  41,
          PROPERTY_POSITION_HISTORY      = 207,
          PROPERTY_CARS_PASS_TO_HEAD     =  34,
          PROPERTY_LATITUDE              =  31,
          PROPERTY_DIRECTION             =  27,
          PROPERTY_BLOCK                 =  22,
          PROPERTY_STAMINA               =   9,
          PROPERTY_HEAD                  =  12,
          PROPERTY_EDGES                 = 242,
          PROPERTY_BUILDING_CODE         =  50,
          PROPERTY_SIGNAL                =  44,
          PROPERTY_FIERYNESS             =  16,
          PROPERTY_WIND_DIRECTION        =  33,
          PROPERTY_LENGTH                =  24,
          PROPERTY_FLOORS                =  14,
          PROPERTY_HUMANS_PASS_TO_TAIL   =  37,
          PROPERTY_ROAD_KIND             =  19,
          PROPERTY_REPAIR_COST           =  39,
          PROPERTY_IGNITION              =  48,
          PROPERTY_BUILDING_AREA_GROUND  =  51,
          PROPERTY_BROKENNESS            =  17,
          PROPERTY_WIND_FORCE            =  32,
          PROPERTY_SHORTCUT_TO_TURN      = 128,
          PROPERTY_WIDTH_FOR_WALKERS     =  43,
          PROPERTY_MEDIAN_STRIP          =  40,
          PROPERTY_Y                     =   4,
          PROPERTY_ENTRANCES             = 235,
          PROPERTY_X                     =   3,
          PROPERTY_POSITION              =   6,
          PROPERTY_POSITION_EXTRA        =   7,
          PROPERTY_WATER_QUANTITY        =  25,
          PROPERTY_LONGITUDE             =  30,
          PROPERTY_STRETCHED_LENGTH      =  26,
          PROPERTY_HUMANS_PASS_TO_HEAD   =  36,
          PROPERTY_BURIEDNESS            =  23,
          PROPERTY_LINES_TO_TAIL         =  42,
          PROPERTY_HP                    =  10,
          PROPERTY_BUILDING_APEXES       = 131,
          PROPERTY_DAMAGE                =  11,
          PROPERTY_CARS_PASS_TO_TAIL     =  35,
          PROPERTY_BUILDING_ATTRIBUTES   =  15,
          PROPERTY_POCKET_TO_TURN_ACROSS = 129,
          PROPERTY_TAIL                  =  13;

      static final int
          AGENT_TYPE_CIVILIAN         =  1,
          AGENT_TYPE_FIRE_BRIGADE     =  2,
          AGENT_TYPE_FIRE_STATION     =  4,
          AGENT_TYPE_AMBULANCE_TEAM   =  8,
          AGENT_TYPE_AMBULANCE_CENTER = 16,
          AGENT_TYPE_POLICE_FORCE     = 32,
          AGENT_TYPE_POLICE_OFFICE    = 64;
*/
}
