Ejemplo n.º 1
0
  @Override
  protected Boolean updateVisibility(LiveGameData gameData, boolean isEditorMode) {
    super.updateVisibility(gameData, isEditorMode);

    ScoringInfo scoringInfo = gameData.getScoringInfo();

    if (!startedPositionsInitialized) initStartedFromPositions(scoringInfo);
    if (RaceInfosWidget.visible()) return false;

    currentLap.update(scoringInfo.getLeadersVehicleScoringInfo().getLapsCompleted());

    if (currentLap.hasChanged()
            && currentLap.getValue() > 0
            && (short) (Math.random() * randMulti.getValue()) == 0
        || isEditorMode) {

      // fetch what data is shown others-gaps 1-places gained/lost
      if (scoringInfo.getLeadersVehicleScoringInfo().getFinishStatus().isFinished() || isEditorMode)
        shownData = 1;
      else shownData = (short) (Math.random() * 2);

      if (scoringInfo.getGamePhase() == GamePhase.SESSION_OVER)
        visibleEnd = scoringInfo.getSessionNanos() + visibleTime.getDelayNanos() * 3;
      else visibleEnd = scoringInfo.getSessionNanos() + visibleTime.getDelayNanos();

      clearArrayValues(scoringInfo.getNumVehicles());
      FillArrayValues(1, scoringInfo, isEditorMode, gameData);
      if (!isEditorMode) forceCompleteRedraw(true);

      return true;
    }

    if (scoringInfo.getSessionNanos() < visibleEnd || isEditorMode) {
      // how many on the same lap?
      int onlap = 0;
      for (int j = 0; j < scoringInfo.getNumVehicles(); j++) {
        if (scoringInfo.getVehicleScoringInfo(j).getLapsCompleted()
            == scoringInfo.getLeadersVehicleScoringInfo().getLapsCompleted()) onlap++;
      }

      carsOnLeadLap.update(onlap);
      if (carsOnLeadLap.hasChanged() && !isEditorMode) {
        FillArrayValues(onlap, scoringInfo, false, gameData);
        forceCompleteRedraw(true);
      }
      return true;
    }

    return false;
  }
Ejemplo n.º 2
0
  @Override
  protected Boolean updateVisibility(LiveGameData gameData, boolean isEditorMode) {

    super.updateVisibility(gameData, isEditorMode);
    ScoringInfo scoringInfo = gameData.getScoringInfo();
    cveh.update(scoringInfo.getViewedVehicleScoringInfo().getDriverId());
    cpit.update(scoringInfo.getViewedVehicleScoringInfo().isInPits());

    if (QualTimeWidget.visible()) return false;

    if ((cveh.hasChanged() || cpit.hasChanged()) && !isEditorMode) {
      forceCompleteRedraw(true);
      visibleEnd = scoringInfo.getSessionNanos() + visibleTime.getDelayNanos();
      return true;
    }

    if (scoringInfo.getSessionNanos() < visibleEnd || cpit.getValue()) return true;

    return false;
  }