/** * Add an entry to the StartList rejecting any duplicate Bib assignments in the same race class It * is possible to have the same bib in a different classes in lower levels of races (e.g. C1 and * C2) * * @param racer * @param boatClass * @throws DuplicateBibException */ public void addBoat(Racer racer, String boatClass) throws DuplicateBibException { if (count(racer.getBibNumber(), boatClass) < 1) { racers.add(racer); startList.add(new BoatEntry(racer, boatClass)); } else { log.error( "Can't add bib " + racer.getBibNumber() + " for " + boatClass + " " + racer.getShortName() + " already used by " + whoIs(racer.getBibNumber(), boatClass)); throw new DuplicateBibException(); } }
private boolean sameRun(RaceRun ourRun, RaceRun otherRun) { boolean same = false; BoatEntry b; Racer racer; String bib; try { b = ourRun.getBoat(); racer = b.getRacer(); bib = racer.getBibNumber(); if (bib.compareTo(otherRun.getBoat().getRacer().getBibNumber()) == 0) { if (ourRun.getRunNumber() == otherRun.getRunNumber()) { same = true; } } } catch (Exception e) { e.printStackTrace(); } return (same); }
private boolean sameRun(RaceRun ourRun, PhotoCellRaceRun otherRun) { boolean same = false; BoatEntry b; Racer racer; String bib; try { b = ourRun.getBoat(); racer = b.getRacer(); bib = racer.getBibNumber(); if (bib.compareTo(otherRun.getBibNumber()) == 0) { // We only want to store real time Tag Heuer electronic eye times // with the current run if (ourRun.getRunNumber() == otherRun.getRunNumber()) { same = true; } } } catch (Exception e) { e.printStackTrace(); } return (same); }
/** * Prints the racer's current position and current velocity. * * @param racer racer of which values to print */ public void printRacer(Racer racer) { println("Racer pos: " + racer.getPos().getX() + " " + racer.getPos().getY()); println("Racer vel: " + racer.getVel().getX() + " " + racer.getVel().getY()); }