+import Participant from './Participant';
+import Tournament from './Tournament';
+
+export const isComplete = (tournament, round) => {
+ if (!tournament || !tournament.participants) return false;
+ if (!round || !round.results) return false;
+ const runners = Tournament.getRunners(tournament);
+ if (!runners.length) return false;
+ for (let i = 0; i < runners.length; ++i) {
+ const result = Participant.findResult(runners[i], round);
+ if (!result || !result.has_finished) return false;
+ }
+ return true;
+};
+
export const patchResult = (round, result) => {
if (!round) return round;
if (!round.results || !round.results.length) {
};
export default {
+ isComplete,
patchResult,
};