Пример #1
0
  /**
   * This function allows you to draw units onto the map. - they only show up on the local player's
   * screen - they will be drawn in the "standard pose" (as if before any COB scripts are run)
   *
   * @param rotation in radians
   * @param lifeTime specifies how many frames a figure should live before being auto-removed; 0
   *     means no removal
   * @param teamId teamId affects the color of the unit
   */
  @Override
  public void drawUnit(
      UnitDef toDrawUnitDef,
      AIFloat3 pos,
      float rotation,
      int lifeTime,
      int teamId,
      boolean transparent,
      boolean drawBorder,
      int facing)
      throws CallbackAIException {

    int _ret_int;

    float[] pos_posF3 = pos.toFloatArray();
    int toDrawUnitDefId = toDrawUnitDef.getUnitDefId();

    _ret_int =
        innerCallback.Map_Drawer_drawUnit(
            toDrawUnitDefId,
            pos_posF3,
            rotation,
            lifeTime,
            teamId,
            transparent,
            drawBorder,
            facing);
    if (_ret_int != 0) {
      throw new CallbackAIException("drawUnit", _ret_int);
    }
  }
Пример #2
0
  /**
   * @param options see enum UnitCommandOptions
   * @param timeOut At which frame the command will time-out and consequently be removed, if
   *     execution of it has not yet begun. Can only be set locally, is not sent over the network,
   *     and is used for temporary orders. default: MAX_INT (-> do not time-out) example:
   *     currentFrame + 15
   * @param facing set it to UNIT_COMMAND_BUILD_NO_FACING, if you do not want to specify a certain
   *     facing
   */
  @Override
  public void build(
      UnitDef toBuildUnitDef, AIFloat3 buildPos, int facing, short options, int timeOut)
      throws CallbackAIException {

    int _ret_int;

    float[] buildPos_posF3 = buildPos.toFloatArray();
    int toBuildUnitDefId = toBuildUnitDef.getUnitDefId();

    _ret_int =
        innerCallback.Unit_build(
            this.getUnitId(), toBuildUnitDefId, buildPos_posF3, facing, options, timeOut);
    if (_ret_int != 0) {
      throw new CallbackAIException("build", _ret_int);
    }
  }