Skip to content

Commit

Permalink
first pass WH diff
Browse files Browse the repository at this point in the history
  • Loading branch information
swantzter committed Oct 4, 2024
1 parent e76dd63 commit d6e38c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/models/competition-events/ijru.freestyle.sr@4.0.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { clampNumber, filterMarkStream, filterTally, formatFactor, matchMeta, ro
import type { CompetitionEventModel, JudgeTypeGetter, Options, ScoreTally, TableDefinition } from '../types'
import { ijruAverage } from './ijru.freestyle@3.0.0'

type Option = 'discipline' | 'interactions' |
export type Option = 'discipline' | 'interactions' |
'maxRqGymnasticsPower' | 'maxRqMultiples' | 'maxRqRopeManipulation' |
'maxRqInteractions'

Expand Down Expand Up @@ -500,7 +500,7 @@ export default {
id: 'ijru.freestyle.sr@4.0.0',
name: 'IJRU Single Rope Freestyle v4.0.0',
options: [
{ id: 'discipline', name: 'Discipline', type: 'enum', enum: ['sr', 'dd', 'wh', 'ts', 'xd'] },
{ id: 'discipline', name: 'Discipline', type: 'enum', enum: ['sr'] },
{ id: 'interactions', name: 'Has Interactions', type: 'boolean' },
{ id: 'maxRqGymnasticsPower', name: 'Power/Gymnastics Required Elements', type: 'number', min: 0, step: 1 },
{ id: 'maxRqMultiples', name: 'Multiples Required Elements', type: 'number', min: 0, step: 1 },
Expand All @@ -509,7 +509,7 @@ export default {
],
judges: [presentationJudge, technicalJudge, difficultyJudgeFactory('Dp', 'Difficulty - Power and Gymnastics'), difficultyJudgeFactory('Dm', 'Difficulty - Multiples'), difficultyJudgeFactory('Dr', 'Difficulty - Rope Manipulation')],

calculateEntry (meta, res, options) {
calculateEntry: (meta, res, options) => {
const results = res.filter(r => matchMeta(r.meta, meta))
if (!results.length) return

Expand Down Expand Up @@ -587,7 +587,7 @@ export default {
statuses: {},
}

Check warning on line 588 in lib/models/competition-events/ijru.freestyle.sr@4.0.0.ts

View check run for this annotation

Codecov / codecov/patch

lib/models/competition-events/ijru.freestyle.sr@4.0.0.ts#L513-L588

Added lines #L513 - L588 were not covered by tests
},
rankEntries (res, options) {
rankEntries: (res, options) => {
let results = [...res]
// const tiePriority = ['R', 'M', 'Q', 'P', 'D'] as const
results.sort(function (a, b) {
Expand Down
23 changes: 23 additions & 0 deletions lib/models/competition-events/ijru.freestyle.wh@4.0.0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { CompetitionEventModel } from '../types'
import type { Option } from './ijru.freestyle.sr@4.0.0'
import { default as SR, difficultyJudgeFactory, freestylePreviewTableHeaders, freestyleResultTableHeaders, presentationJudge, technicalJudge } from './ijru.freestyle.sr@4.0.0'

export default {
id: 'ijru.freestyle.wh@4.0.0',
name: 'IJRU Wheel Freestyle v4.0.0',
options: [
{ id: 'discipline', name: 'Discipline', type: 'enum', enum: ['wh'] },
{ id: 'interactions', name: 'Has Interactions', type: 'boolean' },
{ id: 'maxRqGymnasticsPower', name: 'Power/Gymnastics Required Elements', type: 'number', min: 0, step: 1 },
{ id: 'maxRqMultiples', name: 'Multiples Required Elements', type: 'number', min: 0, step: 1 },
{ id: 'maxRqRopeManipulation', name: 'Rope Manipulation Required Elements', type: 'number', min: 0, step: 1 },
{ id: 'maxRqInteractions', name: 'Interactions Required Elements', type: 'number', min: 0, step: 1 },
],
judges: [presentationJudge, technicalJudge, difficultyJudgeFactory('Da', 'Difficulty - Athlete A'), difficultyJudgeFactory('Db', 'Difficulty - Athlete B')],

calculateEntry: SR.calculateEntry,
rankEntries: SR.rankEntries,

previewTable: options => freestylePreviewTableHeaders(options),
resultTable: options => freestyleResultTableHeaders,
} satisfies CompetitionEventModel<Option>

0 comments on commit d6e38c9

Please sign in to comment.