コード例 #1
0
  private void prepareNextLeg() {
    if (state == AT_THE_DEPARTURE_TRANSFER_TERMINAL) {
      state = ENTERING_THE_DEPARTURE_TERMINAL;
      zoneGeneral.setPassengerState(id, state);
    }

    randomSleep(100);

    // Wait until everyone is ready and leave
    zoneEnEx.goingHome(id);
  }
コード例 #2
0
  private void enterTheBus() {
    if (state == AT_THE_ARRIVAL_TRANSFER_TERMINAL) {
      state = TERMINAL_TRANSFER;
      zoneGeneral.setPassengerState(id, state);
    }

    randomSleep(100);

    // Wait for the bus to finish
    zoneTD.finishBusTrip();

    leaveTheBus();
  }
コード例 #3
0
  private void takeABus() {
    if (state == AT_THE_DISEMBARKING_ZONE) {
      state = AT_THE_ARRIVAL_TRANSFER_TERMINAL;
      zoneGeneral.setPassengerState(id, state);
    }

    randomSleep(100);

    // Get on the bus
    zoneTA.takeABus(id);

    enterTheBus();
  }
コード例 #4
0
  private void goHome() {
    if (state == AT_THE_LUGGAGE_COLLECTION_POINT
        || state == AT_THE_BAGGAGE_RECLAIM_OFFICE
        || state == AT_THE_DISEMBARKING_ZONE) {
      state = EXITING_THE_ARRIVAL_TERMINAL;
      zoneGeneral.setPassengerState(id, state);
    }

    randomSleep(100);

    // Wait until everyone is ready and leave
    zoneEnEx.goingHome(id);
  }
コード例 #5
0
  private void reportMissingBags(int bags) {
    if (state == AT_THE_LUGGAGE_COLLECTION_POINT) {
      state = AT_THE_BAGGAGE_RECLAIM_OFFICE;
      zoneGeneral.setPassengerState(id, state);
    }

    randomSleep(100);

    // Report luggage missing
    zoneLug.reportLuggageMissing(bags);

    goHome();
  }
コード例 #6
0
  private void leaveTheBus() {
    if (state == TERMINAL_TRANSFER) {
      state = AT_THE_DEPARTURE_TRANSFER_TERMINAL;
      zoneGeneral.setPassengerState(id, state);
    }

    randomSleep(100);

    // Leave the bus
    requestId++;
    zoneTD.leaveBus(id, requestId);

    prepareNextLeg();
  }
コード例 #7
0
  private void goCollectABag() {
    if (state == AT_THE_DISEMBARKING_ZONE) {
      state = AT_THE_LUGGAGE_COLLECTION_POINT;
      zoneGeneral.setPassengerState(id, state);
    }

    randomSleep(100);

    // Pick up all his luggage
    luggageMissing -= zoneLug.getLuggage(id, luggageMissing);

    // If no lost bags
    if (luggageMissing == 0) {
      goHome();
    } // If any bags lost
    else {
      reportMissingBags(luggageMissing);
    }
  }