예제 #1
0
  protected void initializeArgumentTypeInfo() {
    super.initializeArgumentTypeInfo();

    Map sizeByArgumentTypeMap = super.getSizeByArgumentTypeMap();
    sizeByArgumentTypeMap.put(new Integer(ARGUMENT_TYPE__DIALOG_NUMBER), new Integer(2));

    Map argumentDataTypeByArgumentTypeMap = super.getArgumentDataTypeByArgumentTypeMap();
    argumentDataTypeByArgumentTypeMap.put(
        new Integer(ARGUMENT_TYPE__DIALOG_NUMBER), new Integer(ARGUMENT_DATA_TYPE__UNSIGNED_SHORT));
  }
예제 #2
0
  protected void initializeCommandTypeInfo() {
    super.initializeCommandTypeInfo();

    Map mm7ArgumentTypeArrayByCommandTypeMap = super.getArgumentTypeArrayByCommandTypeMap();
    Map mm7ArgumentTypeDisplayInfoArrayByCommandTypeMap =
        super.getArgumentTypeDisplayInfoArrayByCommandTypeMap();

    Object newArgumentsByCommandType[] =
        new Object[] {
          new Integer(EVENT_COMMAND__ScheduleEvent),
              new Object[] {_I_(ARGUMENT_TYPE__UNKNOWN), null, null, _I_(0)},
          new Integer(EVENT_COMMAND__ScheduleEventSet),
              new Object[] {_I_(ARGUMENT_TYPE__UNKNOWN), null, null, _I_(0)},
          new Integer(EVENT_COMMAND__EV_StopDoor),
              new Object[] {_I_(ARGUMENT_TYPE__UNKNOWN), null, null, _I_(0)},
          new Integer(EVENT_COMMAND__IfHasItemRangeQty),
              new Object[] {_I_(ARGUMENT_TYPE__UNKNOWN), null, null, _I_(0)},
          new Integer(EVENT_COMMAND__TakeItemRangeQty),
              new Object[] {_I_(ARGUMENT_TYPE__UNKNOWN), null, null, _I_(0)},
          new Integer(EVENT_COMMAND__LaunchParty),
              new Object[] {
                _I_(ARGUMENT_TYPE__UNKNOWN_SHORT), "phi", null, _I_(0),
                _I_(ARGUMENT_TYPE__UNKNOWN_SHORT), "theta", null, _I_(1),
                _I_(ARGUMENT_TYPE__UNKNOWN_INTEGER), "velocity", null, _I_(2)
              },
          new Integer(EVENT_COMMAND__IfHasBountyRange),
              new Object[] {_I_(ARGUMENT_TYPE__UNKNOWN), null, null, _I_(0)},
          new Integer(EVENT_COMMAND__IfPCCanAct),
              new Object[] {_I_(ARGUMENT_TYPE__UNKNOWN), null, null, _I_(0)}
        };

    int argumentTypesForCommandTypeArrayColumns = 2;
    if (newArgumentsByCommandType.length % argumentTypesForCommandTypeArrayColumns != 0) {
      throw new RuntimeException(
          "argsAndSizeArray.length = "
              + newArgumentsByCommandType.length
              + " which is not a power of "
              + argumentTypesForCommandTypeArrayColumns
              + ".");
    }

    for (int index = 0;
        index < newArgumentsByCommandType.length;
        index = index + argumentTypesForCommandTypeArrayColumns) {
      Integer commandTypeNumber = (Integer) newArgumentsByCommandType[index];
      Object argumentTypeDataArray[] = (Object[]) newArgumentsByCommandType[index + 1];

      Integer key = null;
      for (int commandTypesIndex = 0;
          commandTypesIndex < commandTypes.length;
          commandTypesIndex++) {
        if (commandTypes[commandTypesIndex].equals(commandTypeNumber)) {
          key = new Integer(commandTypesIndex);
        }
      }
      if (null == key) {
        throw new RuntimeException(
            "Unable to find command type value" + commandTypeNumber + " in commandTypes");
      }

      int[] argumentTypeArray =
          getArgumentTypeArrayFromArgumentTypeDataArray(argumentTypeDataArray);
      Object newArgumentTypeArrayValue = argumentTypeArray;

      if (argumentTypeArrayByCommandTypeMap.containsKey(key)) {
        Object value = mm7ArgumentTypeArrayByCommandTypeMap.get(key);
        throw new RuntimeException(
            "mm7ArgumentTypeArrayByCommandTypeMap already contains key "
                + key
                + " with value of "
                + value);
      }

      mm7ArgumentTypeArrayByCommandTypeMap.put(key, newArgumentTypeArrayValue);

      ArgumentTypeDisplayInfo[] argumentTypeDisplayInfoArray =
          getArgumentTypeDisplayInfoArrayFromArgumentTypeDataArray(argumentTypeDataArray);
      Object newArgumentTypeDisplayInfoArrayValue = argumentTypeDisplayInfoArray;

      if (mm7ArgumentTypeDisplayInfoArrayByCommandTypeMap.containsKey(key)) {
        Object value = mm7ArgumentTypeDisplayInfoArrayByCommandTypeMap.get(key);
        throw new RuntimeException(
            "mm7ArgumentTypeDisplayInfoArrayByCommandTypeMap already contains key "
                + key
                + " with value of "
                + value);
      }

      mm7ArgumentTypeDisplayInfoArrayByCommandTypeMap.put(
          key, newArgumentTypeDisplayInfoArrayValue);
    }
  }