@rian8337/osu-difficulty-calculator 4.0.0-beta.16 → 4.0.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,199 +1,55 @@
1
1
  import { Mod, PlaceableHitObject, Modes, Beatmap, DifficultyStatisticsCalculatorResult, Accuracy } from '@rian8337/osu-base';
2
2
 
3
- /**
4
- * An evaluator for calculating aim skill.
5
- *
6
- * This class should be considered an "evaluating" class and not persisted.
7
- */
8
3
  declare abstract class AimEvaluator {
9
4
  protected static readonly wideAngleMultiplier: number;
10
5
  protected static readonly acuteAngleMultiplier: number;
11
6
  protected static readonly sliderMultiplier: number;
12
7
  protected static readonly velocityChangeMultiplier: number;
13
- /**
14
- * Calculates the bonus of wide angles.
15
- */
16
8
  protected static calculateWideAngleBonus(angle: number): number;
17
- /**
18
- * Calculates the bonus of acute angles.
19
- */
20
9
  protected static calculateAcuteAngleBonus(angle: number): number;
21
10
  }
22
11
 
23
- /**
24
- * Holds data that can be used to calculate performance points.
25
- */
26
12
  interface DifficultyAttributes {
27
- /**
28
- * The mods which were applied to the beatmap.
29
- */
30
13
  mods: Mod[];
31
- /**
32
- * The combined star rating of all skills.
33
- */
34
14
  starRating: number;
35
- /**
36
- * The maximum achievable combo.
37
- */
38
15
  maxCombo: number;
39
- /**
40
- * The difficulty corresponding to the aim skill.
41
- */
42
16
  aimDifficulty: number;
43
- /**
44
- * The difficulty corresponding to the flashlight skill.
45
- */
46
17
  flashlightDifficulty: number;
47
- /**
48
- * The number of clickable objects weighted by difficulty.
49
- *
50
- * Related to speed/tap difficulty.
51
- */
52
18
  speedNoteCount: number;
53
- /**
54
- * Describes how much of aim difficulty is contributed to by hitcircles or sliders.
55
- *
56
- * A value closer to 1 indicates most of aim difficulty is contributed by hitcircles.
57
- *
58
- * A value closer to 0 indicates most of aim difficulty is contributed by sliders.
59
- */
60
19
  sliderFactor: number;
61
- /**
62
- * The overall clock rate that was applied to the beatmap.
63
- */
64
20
  clockRate: number;
65
- /**
66
- * The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc).
67
- *
68
- * Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
69
- */
70
21
  approachRate: number;
71
- /**
72
- * The perceived overall difficulty inclusive of rate-adjusting mods (DT/HT/etc), based on osu!standard judgement.
73
- *
74
- * Rate-adjusting mods don't directly affect the overall difficulty value, but have a perceived effect as a result of adjusting audio timing.
75
- */
76
22
  overallDifficulty: number;
77
- /**
78
- * The number of hitcircles in the beatmap.
79
- */
80
23
  hitCircleCount: number;
81
- /**
82
- * The number of sliders in the beatmap.
83
- */
84
24
  sliderCount: number;
85
- /**
86
- * The number of spinners in the beatmap.
87
- */
88
25
  spinnerCount: number;
89
26
  }
90
27
 
91
- /**
92
- * Represents difficulty attributes that can be cached.
93
- */
94
28
  type CacheableDifficultyAttributes<T extends DifficultyAttributes> = Omit<T, "mods"> & {
95
- /**
96
- * The mods which were applied to the beatmap.
97
- */
98
29
  mods: string;
99
30
  };
100
31
 
101
- /**
102
- * Represents options for difficulty calculation.
103
- */
104
32
  interface DifficultyCalculationOptions {
105
- /**
106
- * The modifications to apply.
107
- */
108
33
  readonly mods?: Mod[];
109
- /**
110
- * The custom speed multiplier to apply. Defaults to 1.
111
- */
112
34
  readonly customSpeedMultiplier?: number;
113
35
  }
114
36
 
115
- /**
116
- * Represents a hit object with difficulty calculation values.
117
- */
118
37
  declare abstract class DifficultyHitObject {
119
- /**
120
- * The underlying hitobject.
121
- */
122
38
  readonly object: PlaceableHitObject;
123
- /**
124
- * The index of this hitobject in the list of all hitobjects.
125
- *
126
- * This is one less than the actual index of the hitobject in the beatmap.
127
- */
128
39
  readonly index: number;
129
- /**
130
- * The aim strain generated by the hitobject if sliders are considered.
131
- */
132
40
  aimStrainWithSliders: number;
133
- /**
134
- * The aim strain generated by the hitobject if sliders are not considered.
135
- */
136
41
  aimStrainWithoutSliders: number;
137
- /**
138
- * The rhythm multiplier generated by the hitobject. This is used to alter tap strain.
139
- */
140
42
  rhythmMultiplier: number;
141
- /**
142
- * The normalized distance from the "lazy" end position of the previous hitobject to the start position of this hitobject.
143
- *
144
- * The "lazy" end position is the position at which the cursor ends up if the previous hitobject is followed with as minimal movement as possible (i.e. on the edge of slider follow circles).
145
- */
146
43
  lazyJumpDistance: number;
147
- /**
148
- * The normalized shortest distance to consider for a jump between the previous hitobject and this hitobject.
149
- *
150
- * This is bounded from above by `lazyJumpDistance`, and is smaller than the former if a more natural path is able to be taken through the previous hitobject.
151
- *
152
- * Suppose a linear slider - circle pattern. Following the slider lazily (see: `lazyJumpDistance`) will result in underestimating the true end position of the slider as being closer towards the start position.
153
- * As a result, `lazyJumpDistance` overestimates the jump distance because the player is able to take a more natural path by following through the slider to its end,
154
- * such that the jump is felt as only starting from the slider's true end position.
155
- *
156
- * Now consider a slider - circle pattern where the circle is stacked along the path inside the slider.
157
- * In this case, the lazy end position correctly estimates the true end position of the slider and provides the more natural movement path.
158
- */
159
44
  minimumJumpDistance: number;
160
- /**
161
- * The time taken to travel through `minimumJumpDistance`, with a minimum value of 25ms.
162
- */
163
45
  minimumJumpTime: number;
164
- /**
165
- * The normalized distance between the start and end position of this hitobject.
166
- */
167
46
  travelDistance: number;
168
- /**
169
- * The time taken to travel through `travelDistance`, with a minimum value of 25ms for sliders.
170
- */
171
47
  travelTime: number;
172
- /**
173
- * Angle the player has to take to hit this hitobject.
174
- *
175
- * Calculated as the angle between the circles (current-2, current-1, current).
176
- */
177
48
  angle: number | null;
178
- /**
179
- * The amount of milliseconds elapsed between this hitobject and the last hitobject.
180
- */
181
49
  readonly deltaTime: number;
182
- /**
183
- * The amount of milliseconds elapsed since the start time of the previous hitobject, with a minimum of 25ms.
184
- */
185
50
  readonly strainTime: number;
186
- /**
187
- * Adjusted start time of the hitobject, taking speed multiplier into account.
188
- */
189
51
  readonly startTime: number;
190
- /**
191
- * Adjusted end time of the hitobject, taking speed multiplier into account.
192
- */
193
52
  readonly endTime: number;
194
- /**
195
- * Other hitobjects in the beatmap, including this hitobject.
196
- */
197
53
  protected readonly hitObjects: readonly DifficultyHitObject[];
198
54
  protected abstract readonly mode: Modes;
199
55
  protected readonly normalizedRadius = 50;
@@ -202,56 +58,10 @@ declare abstract class DifficultyHitObject {
202
58
  protected readonly minDeltaTime = 25;
203
59
  private readonly lastObject;
204
60
  private readonly lastLastObject;
205
- /**
206
- * Note: You **must** call `computeProperties` at some point due to how TypeScript handles
207
- * overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue.).
208
- *
209
- * @param object The underlying hitobject.
210
- * @param lastObject The hitobject before this hitobject.
211
- * @param lastLastObject The hitobject before the last hitobject.
212
- * @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
213
- * @param clockRate The clock rate of the beatmap.
214
- * @param timePreempt The time preempt with clock rate.
215
- * @param isForceAR Whether force AR is enabled.
216
- * @param mode The gamemode to compute properties for.
217
- */
218
61
  protected constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number);
219
- /**
220
- * Computes the properties of this hitobject.
221
- *
222
- * @param clockRate The clock rate of the beatmap.
223
- * @param hitObjects The hitobjects in the beatmap.
224
- */
225
62
  computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
226
- /**
227
- * Gets the difficulty hitobject at a specific index with respect to the current
228
- * difficulty hitobject's index.
229
- *
230
- * Will return `null` if the index is out of range.
231
- *
232
- * @param backwardsIndex The index to move backwards for.
233
- * @returns The difficulty hitobject at the index with respect to the current
234
- * difficulty hitobject's index, `null` if the index is out of range.
235
- */
236
63
  previous(backwardsIndex: number): this | null;
237
- /**
238
- * Gets the difficulty hitobject at a specific index with respect to the current
239
- * difficulty hitobject's index.
240
- *
241
- * Will return `null` if the index is out of range.
242
- *
243
- * @param forwardsIndex The index to move forwards for.
244
- * @returns The difficulty hitobject at the index with respect to the current
245
- * difficulty hitobject's index, `null` if the index is out of range.
246
- */
247
64
  next(forwardsIndex: number): this | null;
248
- /**
249
- * Calculates the opacity of the hitobject at a given time.
250
- *
251
- * @param time The time to calculate the hitobject's opacity at.
252
- * @param isHidden Whether Hidden mod is used.
253
- * @returns The opacity of the hitobject at the given time.
254
- */
255
65
  opacityAt(time: number, isHidden: boolean): number;
256
66
  protected abstract get scalingFactor(): number;
257
67
  protected setDistances(clockRate: number): void;
@@ -259,343 +69,95 @@ declare abstract class DifficultyHitObject {
259
69
  private getEndCursorPosition;
260
70
  }
261
71
 
262
- /**
263
- * Represents the strain peaks of various calculated difficulties.
264
- */
265
72
  interface StrainPeaks {
266
- /**
267
- * The strain peaks of aim difficulty if sliders are considered.
268
- */
269
73
  aimWithSliders: number[];
270
- /**
271
- * The strain peaks of aim difficulty if sliders are not considered.
272
- */
273
74
  aimWithoutSliders: number[];
274
- /**
275
- * The strain peaks of speed difficulty.
276
- */
277
75
  speed: number[];
278
- /**
279
- * The strain peaks of flashlight difficulty.
280
- */
281
76
  flashlight: number[];
282
77
  }
283
78
 
284
- /**
285
- * A bare minimal abstract skill for fully custom skill implementations.
286
- *
287
- * This class should be considered a "processing" class and not persisted.
288
- */
289
79
  declare abstract class Skill {
290
- /**
291
- * The mods that this skill processes.
292
- */
293
80
  protected readonly mods: Mod[];
294
81
  constructor(mods: Mod[]);
295
- /**
296
- * Processes a hitobject.
297
- *
298
- * @param current The hitobject to process.
299
- */
300
82
  abstract process(current: DifficultyHitObject): void;
301
- /**
302
- * Returns the calculated difficulty value representing all hitobjects that have been processed up to this point.
303
- */
304
83
  abstract difficultyValue(): number;
305
84
  }
306
85
 
307
- /**
308
- * The base of a difficulty calculator.
309
- */
310
86
  declare abstract class DifficultyCalculator<THitObject extends DifficultyHitObject, TAttributes extends DifficultyAttributes> {
311
- /**
312
- * The calculated beatmap.
313
- */
314
87
  readonly beatmap: Beatmap;
315
- /**
316
- * The difficulty objects of the beatmap.
317
- */
318
88
  readonly objects: THitObject[];
319
- /**
320
- * The modifications applied.
321
- */
322
89
  mods: Mod[];
323
- /**
324
- * The total star rating of the beatmap.
325
- */
326
90
  get total(): number;
327
- /**
328
- * The difficulty statistics of the beatmap after modifications are applied.
329
- */
330
91
  difficultyStatistics: DifficultyStatisticsCalculatorResult<number, number, number, number>;
331
- /**
332
- * The strain peaks of various calculated difficulties.
333
- */
334
92
  readonly strainPeaks: StrainPeaks;
335
- /**
336
- * The difficulty attributes that can be used to calculate performance points.
337
- */
338
93
  abstract readonly attributes: TAttributes;
339
- /**
340
- * The difficulty attributes that can be cached. It can also be used to calculate performance points.
341
- */
342
94
  abstract get cacheableAttributes(): CacheableDifficultyAttributes<TAttributes>;
343
95
  protected abstract readonly difficultyMultiplier: number;
344
96
  protected abstract readonly mode: Modes;
345
- /**
346
- * Constructs a new instance of the calculator.
347
- *
348
- * @param beatmap The beatmap to calculate. This beatmap will be deep-cloned to prevent reference changes.
349
- */
350
97
  constructor(beatmap: Beatmap);
351
- /**
352
- * Calculates the star rating of the specified beatmap.
353
- *
354
- * The beatmap is analyzed in chunks of `sectionLength` duration.
355
- * For each chunk the highest hitobject strains are added to
356
- * a list which is then collapsed into a weighted sum, much
357
- * like scores are weighted on a user's profile.
358
- *
359
- * For subsequent chunks, the initial max strain is calculated
360
- * by decaying the previous hitobject's strain until the
361
- * beginning of the new chunk.
362
- *
363
- * @param options Options for the difficulty calculation.
364
- * @returns The current instance.
365
- */
366
98
  calculate(options?: DifficultyCalculationOptions): this;
367
- /**
368
- * Generates difficulty hitobjects for this calculator.
369
- *
370
- * @param beatmap The beatmap to generate difficulty hitobjects from.
371
- */
372
99
  protected abstract generateDifficultyHitObjects(beatmap: Beatmap): THitObject[];
373
- /**
374
- * Computes the difficulty statistics of the original beatmap with respect to the used options.
375
- *
376
- * @param options The options to use for the difficulty statistics calculation.
377
- * @returns The computed difficulty statistics.
378
- */
379
100
  protected abstract computeDifficultyStatistics(options?: DifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
380
- /**
381
- * Calculates the skills provided.
382
- *
383
- * @param skills The skills to calculate.
384
- */
385
101
  protected calculateSkills(...skills: Skill[]): void;
386
- /**
387
- * Calculates the total star rating of the beatmap and stores it in this instance.
388
- */
389
102
  abstract calculateTotal(): void;
390
- /**
391
- * Calculates every star rating of the beatmap and stores it in this instance.
392
- */
393
103
  abstract calculateAll(): void;
394
- /**
395
- * Returns a string representative of the class.
396
- */
397
104
  abstract toString(): string;
398
- /**
399
- * Creates skills to be calculated.
400
- */
401
105
  protected abstract createSkills(): Skill[];
402
- /**
403
- * Populates the stored difficulty attributes with necessary data.
404
- */
405
106
  protected populateDifficultyAttributes(): void;
406
- /**
407
- * Calculates the star rating value of a difficulty.
408
- *
409
- * @param difficulty The difficulty to calculate.
410
- */
411
107
  protected starValue(difficulty: number): number;
412
- /**
413
- * Calculates the base performance value of a difficulty rating.
414
- *
415
- * @param rating The difficulty rating.
416
- */
417
108
  protected basePerformanceValue(rating: number): number;
418
109
  }
419
110
 
420
- /**
421
- * Represents a slider that is considered difficult.
422
- *
423
- * This structure is a part of difficulty attributes and can be cached.
424
- */
425
111
  interface DifficultSlider {
426
- /**
427
- * The index of the slider in the beatmap.
428
- */
429
112
  readonly index: number;
430
- /**
431
- * The difficulty rating of this slider compared to other sliders, based on the velocity of the slider.
432
- *
433
- * A value closer to 1 indicates that this slider is more difficult compared to most sliders.
434
- *
435
- * A value closer to 0 indicates that this slider is easier compared to most sliders.
436
- */
437
113
  readonly difficultyRating: number;
438
114
  }
439
115
 
440
- /**
441
- * Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
442
- * and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
443
- */
444
116
  declare abstract class StrainSkill extends Skill {
445
- /**
446
- * Strain peaks are stored here.
447
- */
448
117
  readonly strainPeaks: number[];
449
- /**
450
- * The number of sections with the highest strains, which the peak strain reductions will apply to.
451
- * This is done in order to decrease their impact on the overall difficulty of the map for this skill.
452
- */
453
118
  protected abstract readonly reducedSectionCount: number;
454
- /**
455
- * The baseline multiplier applied to the section with the biggest strain.
456
- */
457
119
  protected abstract readonly reducedSectionBaseline: number;
458
- /**
459
- * Determines how quickly strain decays for the given skill.
460
- *
461
- * For example, a value of 0.15 indicates that strain decays to 15% of its original value in one second.
462
- */
463
120
  protected abstract readonly strainDecayBase: number;
464
121
  private readonly sectionLength;
465
122
  private currentStrain;
466
123
  private currentSectionPeak;
467
124
  private currentSectionEnd;
468
125
  process(current: DifficultyHitObject): void;
469
- /**
470
- * Saves the current peak strain level to the list of strain peaks, which will be used to calculate an overall difficulty.
471
- */
472
126
  saveCurrentPeak(): void;
473
- /**
474
- * Calculates strain decay for a specified time frame.
475
- *
476
- * @param ms The time frame to calculate.
477
- */
478
127
  protected strainDecay(ms: number): number;
479
- /**
480
- * Calculates the strain value at a hitobject.
481
- *
482
- * @param current The hitobject to calculate.
483
- */
484
128
  protected abstract strainValueAt(current: DifficultyHitObject): number;
485
- /**
486
- * Saves the current strain to a hitobject.
487
- */
488
129
  protected abstract saveToHitObject(current: DifficultyHitObject): void;
489
- /**
490
- * Retrieves the peak strain at a point in time.
491
- *
492
- * @param time The time to retrieve the peak strain at.
493
- * @param current The current hit object.
494
- * @returns The peak strain.
495
- */
496
130
  protected abstract calculateInitialStrain(time: number, current: DifficultyHitObject): number;
497
- /**
498
- * Sets the initial strain level for a new section.
499
- *
500
- * @param time The beginning of the new section in milliseconds.
501
- * @param current The current hitobject.
502
- */
503
131
  private startNewSectionFrom;
504
132
  }
505
133
 
506
- /**
507
- * Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
508
- * and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
509
- */
510
134
  declare abstract class DroidSkill extends StrainSkill {
511
- /**
512
- * The bonus multiplier that is given for a sequence of notes of equal difficulty.
513
- */
514
135
  protected abstract readonly starsPerDouble: number;
515
136
  difficultyValue(): number;
516
137
  }
517
138
 
518
- /**
519
- * Represents an osu!droid hit object with difficulty calculation values.
520
- */
521
139
  declare class DroidDifficultyHitObject extends DifficultyHitObject {
522
- /**
523
- * The tap strain generated by the hitobject.
524
- */
525
140
  tapStrain: number;
526
- /**
527
- * The tap strain generated by the hitobject if `strainTime` isn't modified by
528
- * OD. This is used in three-finger detection.
529
- */
530
141
  originalTapStrain: number;
531
- /**
532
- * The rhythm strain generated by the hitobject.
533
- */
534
142
  rhythmStrain: number;
535
- /**
536
- * The flashlight strain generated by the hitobject if sliders are considered.
537
- */
538
143
  flashlightStrainWithSliders: number;
539
- /**
540
- * The flashlight strain generated by the hitobject if sliders are not considered.
541
- */
542
144
  flashlightStrainWithoutSliders: number;
543
- /**
544
- * The visual strain generated by the hitobject if sliders are considered.
545
- */
546
145
  visualStrainWithSliders: number;
547
- /**
548
- * The visual strain generated by the hitobject if sliders are not considered.
549
- */
550
146
  visualStrainWithoutSliders: number;
551
- /**
552
- * The note density of the hitobject.
553
- */
554
147
  noteDensity: number;
555
- /**
556
- * The overlapping factor of the hitobject.
557
- *
558
- * This is used to scale visual skill.
559
- */
560
148
  overlappingFactor: number;
561
- /**
562
- * Adjusted preempt time of the hitobject, taking speed multiplier into account.
563
- */
564
149
  readonly timePreempt: number;
565
150
  private readonly radiusBuffThreshold;
566
151
  protected readonly mode = Modes.droid;
567
152
  protected readonly maximumSliderRadius: number;
568
153
  protected get scalingFactor(): number;
569
- /**
570
- * Note: You **must** call `computeProperties` at some point due to how TypeScript handles
571
- * overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue.).
572
- *
573
- * @param object The underlying hitobject.
574
- * @param lastObject The hitobject before this hitobject.
575
- * @param lastLastObject The hitobject before the last hitobject.
576
- * @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
577
- * @param clockRate The clock rate of the beatmap.
578
- * @param isForceAR Whether force AR is enabled.
579
- */
580
154
  constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, isForceAR: boolean);
581
155
  computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
582
- /**
583
- * Determines whether this hitobject is considered overlapping with the hitobject before it.
584
- *
585
- * Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
586
- * can be hit with just a single tap in osu!droid.
587
- *
588
- * @param considerDistance Whether to consider the distance between both hitobjects.
589
- * @returns Whether the hitobject is considered overlapping.
590
- */
591
156
  isOverlapping(considerDistance: boolean): boolean;
592
157
  private setVisuals;
593
158
  private applyToOverlappingFactor;
594
159
  }
595
160
 
596
- /**
597
- * Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
598
- */
599
161
  declare class DroidAim extends DroidSkill {
600
162
  protected readonly strainDecayBase: number;
601
163
  protected readonly reducedSectionCount: number;
@@ -607,204 +169,66 @@ declare class DroidAim extends DroidSkill {
607
169
  constructor(mods: Mod[], withSliders: boolean);
608
170
  protected strainValueAt(current: DroidDifficultyHitObject): number;
609
171
  protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
610
- /**
611
- * @param current The hitobject to save to.
612
- */
613
172
  protected saveToHitObject(current: DroidDifficultyHitObject): void;
614
173
  }
615
174
 
616
- /**
617
- * An evaluator for calculating osu!droid Aim skill.
618
- */
619
175
  declare abstract class DroidAimEvaluator extends AimEvaluator {
620
176
  protected static readonly wideAngleMultiplier: number;
621
177
  protected static readonly sliderMultiplier: number;
622
178
  protected static readonly velocityChangeMultiplier: number;
623
179
  private static readonly singleSpacingThreshold;
624
180
  private static readonly minSpeedBonus;
625
- /**
626
- * Evaluates the difficulty of aiming the current object, based on:
627
- *
628
- * - cursor velocity to the current object,
629
- * - angle difficulty,
630
- * - sharp velocity increases,
631
- * - and slider difficulty.
632
- *
633
- * @param current The current object.
634
- * @param withSliders Whether to take slider difficulty into account.
635
- */
636
181
  static evaluateDifficultyOf(current: DroidDifficultyHitObject, withSliders: boolean): number;
637
- /**
638
- * Calculates the snap aim strain of a hitobject.
639
- */
640
182
  private static snapAimStrainOf;
641
- /**
642
- * Calculates the flow aim strain of a hitobject.
643
- */
644
183
  private static flowAimStrainOf;
645
184
  }
646
185
 
647
- /**
648
- * Holds data that can be used to calculate osu!droid performance points.
649
- */
650
186
  interface DroidDifficultyAttributes extends DifficultyAttributes {
651
- /**
652
- * The difficulty corresponding to the tap skill.
653
- */
654
187
  tapDifficulty: number;
655
- /**
656
- * The difficulty corresponding to the rhythm skill.
657
- */
658
188
  rhythmDifficulty: number;
659
- /**
660
- * The difficulty corresponding to the visual skill.
661
- */
662
189
  visualDifficulty: number;
663
- /**
664
- * The amount of strains that are considered difficult with respect to the aim skill.
665
- */
666
190
  aimDifficultStrainCount: number;
667
- /**
668
- * The amount of strains that are considered difficult with respect to the tap skill.
669
- */
670
191
  tapDifficultStrainCount: number;
671
- /**
672
- * The amount of strains that are considered difficult with respect to the flashlight skill.
673
- */
674
192
  flashlightDifficultStrainCount: number;
675
- /**
676
- * The amount of strains that are considered difficult with respect to the visual skill.
677
- */
678
193
  visualDifficultStrainCount: number;
679
- /**
680
- * The average delta time of speed objects.
681
- */
682
194
  averageSpeedDeltaTime: number;
683
195
  }
684
196
 
685
- /**
686
- * Represents options for osu!droid difficulty calculation.
687
- */
688
197
  interface DroidDifficultyCalculationOptions extends DifficultyCalculationOptions {
689
- /**
690
- * Whether to calculate for old statistics (1.6.7 and older). Defaults to `false`.
691
- */
692
198
  readonly oldStatistics?: boolean;
693
199
  }
694
200
 
695
- /**
696
- * Represents a beatmap section at which the strains of objects are considerably high.
697
- */
698
201
  interface HighStrainSection {
699
- /**
700
- * The index of the first object in this section with respect to the full beatmap.
701
- */
702
202
  readonly firstObjectIndex: number;
703
- /**
704
- * The index of the last object in this section with respect to the full beatmap.
705
- */
706
203
  readonly lastObjectIndex: number;
707
- /**
708
- * The summed strain of this section.
709
- */
710
204
  readonly sumStrain: number;
711
205
  }
712
206
 
713
- /**
714
- * Holds data that can be used to calculate osu!droid performance points as well
715
- * as doing some analysis using the replay of a score.
716
- */
717
207
  interface ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes {
718
- /**
719
- * The mode of the difficulty calculation.
720
- */
721
208
  mode: "live";
722
- /**
723
- * Possible sections at which the player can use three fingers on.
724
- */
725
209
  possibleThreeFingeredSections: HighStrainSection[];
726
- /**
727
- * Sliders that are considered difficult.
728
- */
729
210
  difficultSliders: DifficultSlider[];
730
- /**
731
- * The number of clickable objects weighted by difficulty.
732
- *
733
- * Related to aim difficulty.
734
- */
735
211
  aimNoteCount: number;
736
- /**
737
- * Describes how much of flashlight difficulty is contributed to by hitcircles or sliders.
738
- *
739
- * A value closer to 1 indicates most of flashlight difficulty is contributed by hitcircles.
740
- *
741
- * A value closer to 0 indicates most of flashlight difficulty is contributed by sliders.
742
- */
743
212
  flashlightSliderFactor: number;
744
- /**
745
- * Describes how much of visual difficulty is contributed to by hitcircles or sliders.
746
- *
747
- * A value closer to 1 indicates most of visual difficulty is contributed by hitcircles.
748
- *
749
- * A value closer to 0 indicates most of visual difficulty is contributed by sliders.
750
- */
751
213
  visualSliderFactor: number;
752
214
  }
753
215
 
754
- /**
755
- * A difficulty calculator for osu!droid gamemode.
756
- */
757
216
  declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDifficultyHitObject, DroidDifficultyAttributes> {
758
- /**
759
- * The aim star rating of the beatmap.
760
- */
761
217
  get aim(): number;
762
- /**
763
- * The tap star rating of the beatmap.
764
- */
765
218
  get tap(): number;
766
- /**
767
- * The rhythm star rating of the beatmap.
768
- */
769
219
  get rhythm(): number;
770
- /**
771
- * The flashlight star rating of the beatmap.
772
- */
773
220
  get flashlight(): number;
774
- /**
775
- * The visual star rating of the beatmap.
776
- */
777
221
  get visual(): number;
778
- /**
779
- * The strain threshold to start detecting for possible three-fingered section.
780
- *
781
- * Increasing this number will result in less sections being flagged.
782
- */
783
222
  static readonly threeFingerStrainThreshold = 175;
784
223
  readonly attributes: ExtendedDroidDifficultyAttributes;
785
224
  get cacheableAttributes(): CacheableDifficultyAttributes<DroidDifficultyAttributes>;
786
225
  protected readonly difficultyMultiplier = 0.18;
787
226
  protected readonly mode = Modes.droid;
788
227
  calculate(options?: DroidDifficultyCalculationOptions): this;
789
- /**
790
- * Calculates the aim star rating of the beatmap and stores it in this instance.
791
- */
792
228
  calculateAim(): void;
793
- /**
794
- * Calculates the tap star rating of the beatmap and stores it in this instance.
795
- */
796
229
  calculateTap(): void;
797
- /**
798
- * Calculates the rhythm star rating of the beatmap and stores it in this instance.
799
- */
800
230
  calculateRhythm(): void;
801
- /**
802
- * Calculates the flashlight star rating of the beatmap and stores it in this instance.
803
- */
804
231
  calculateFlashlight(): void;
805
- /**
806
- * Calculates the visual star rating of the beatmap and stores it in this instance.
807
- */
808
232
  calculateVisual(): void;
809
233
  calculateTotal(): void;
810
234
  calculateAll(): void;
@@ -812,60 +236,16 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDiffic
812
236
  protected generateDifficultyHitObjects(beatmap: Beatmap): DroidDifficultyHitObject[];
813
237
  protected computeDifficultyStatistics(options?: DroidDifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
814
238
  protected createSkills(): DroidSkill[];
815
- /**
816
- * Called after aim skill calculation.
817
- *
818
- * @param aimSkill The aim skill that considers sliders.
819
- * @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
820
- */
821
239
  private postCalculateAim;
822
- /**
823
- * Calculates aim-related attributes.
824
- */
825
240
  private calculateAimAttributes;
826
- /**
827
- * Called after tap skill calculation.
828
- *
829
- * @param tapSkillCheese The tap skill that considers cheesing.
830
- */
831
241
  private postCalculateTap;
832
- /**
833
- * Calculates tap-related attributes.
834
- */
835
242
  private calculateTapAttributes;
836
- /**
837
- * Calculates the sum of strains for possible three-fingered sections.
838
- *
839
- * @param firstObjectIndex The index of the first object in the section.
840
- * @param lastObjectIndex The index of the last object in the section.
841
- * @returns The summed strain of the section.
842
- */
843
243
  private calculateThreeFingerSummedStrain;
844
- /**
845
- * Called after rhythm skill calculation.
846
- *
847
- * @param rhythmSkill The rhythm skill.
848
- */
849
244
  private postCalculateRhythm;
850
- /**
851
- * Called after flashlight skill calculation.
852
- *
853
- * @param flashlightSkill The flashlight skill that considers sliders.
854
- * @param flashlightSkillWithoutSliders The flashlight skill that doesn't consider sliders.
855
- */
856
245
  private postCalculateFlashlight;
857
- /**
858
- * Called after visual skill calculation.
859
- *
860
- * @param visualSkillWithSliders The visual skill that considers sliders.
861
- * @param visualSkillWithoutSliders The visual skill that doesn't consider sliders.
862
- */
863
246
  private postCalculateVisual;
864
247
  }
865
248
 
866
- /**
867
- * Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
868
- */
869
249
  declare class DroidFlashlight extends DroidSkill {
870
250
  protected readonly strainDecayBase: number;
871
251
  protected readonly reducedSectionCount: number;
@@ -882,11 +262,6 @@ declare class DroidFlashlight extends DroidSkill {
882
262
  difficultyValue(): number;
883
263
  }
884
264
 
885
- /**
886
- * An evaluator for calculating flashlight skill.
887
- *
888
- * This class should be considered an "evaluating" class and not persisted.
889
- */
890
265
  declare abstract class FlashlightEvaluator {
891
266
  protected static readonly maxOpacityBonus: number;
892
267
  protected static readonly hiddenBonus: number;
@@ -895,208 +270,53 @@ declare abstract class FlashlightEvaluator {
895
270
  protected static readonly minAngleMultiplier: number;
896
271
  }
897
272
 
898
- /**
899
- * An evaluator for calculating osu!droid Flashlight skill.
900
- */
901
273
  declare abstract class DroidFlashlightEvaluator extends FlashlightEvaluator {
902
- /**
903
- * Evaluates the difficulty of memorizing and hitting the current object, based on:
904
- *
905
- * - distance between a number of previous objects and the current object,
906
- * - the visual opacity of the current object,
907
- * - the angle made by the current object,
908
- * - length and speed of the current object (for sliders),
909
- * - and whether Hidden mod is enabled.
910
- *
911
- * @param current The current object.
912
- * @param isHiddenMod Whether the Hidden mod is enabled.
913
- * @param withSliders Whether to take slider difficulty into account.
914
- */
915
274
  static evaluateDifficultyOf(current: DroidDifficultyHitObject, isHiddenMod: boolean, withSliders: boolean): number;
916
275
  }
917
276
 
918
- /**
919
- * Represents options for performance calculation.
920
- */
921
277
  interface PerformanceCalculationOptions {
922
- /**
923
- * The maximum combo achieved in the score.
924
- */
925
278
  combo?: number;
926
- /**
927
- * The accuracy achieved in the score.
928
- */
929
279
  accPercent?: Accuracy | number;
930
- /**
931
- * The amount of misses achieved in the score.
932
- */
933
280
  miss?: number;
934
- /**
935
- * The tap penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
936
- */
937
281
  tapPenalty?: number;
938
- /**
939
- * The aim slider cheese penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
940
- */
941
282
  aimSliderCheesePenalty?: number;
942
- /**
943
- * The flashlight slider cheese penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
944
- */
945
283
  flashlightSliderCheesePenalty?: number;
946
- /**
947
- * The visual slider cheese penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
948
- */
949
284
  visualSliderCheesePenalty?: number;
950
285
  }
951
286
 
952
- /**
953
- * The base class of performance calculators.
954
- */
955
287
  declare abstract class PerformanceCalculator<T extends DifficultyAttributes> {
956
- /**
957
- * The overall performance value.
958
- */
959
288
  total: number;
960
- /**
961
- * The calculated accuracy.
962
- */
963
289
  computedAccuracy: Accuracy;
964
- /**
965
- * The difficulty attributes that is being calculated.
966
- */
967
290
  readonly difficultyAttributes: T;
968
- /**
969
- * Penalty for combo breaks.
970
- */
971
291
  protected comboPenalty: number;
972
- /**
973
- * The global multiplier to be applied to the final performance value.
974
- *
975
- * This is being adjusted to keep the final value scaled around what it used to be when changing things.
976
- */
977
292
  protected abstract finalMultiplier: number;
978
- /**
979
- * The gamemode to calculate for.
980
- */
981
293
  protected abstract readonly mode: Modes;
982
- /**
983
- * The amount of misses that are filtered out from sliderbreaks.
984
- */
985
294
  protected effectiveMissCount: number;
986
- /**
987
- * Nerf factor used for nerfing beatmaps with very likely dropped sliderends.
988
- */
989
295
  protected sliderNerfFactor: number;
990
- /**
991
- * @param difficultyAttributes The difficulty attributes to calculate.
992
- */
993
296
  constructor(difficultyAttributes: T | CacheableDifficultyAttributes<T>);
994
- /**
995
- * Calculates the performance points of the beatmap.
996
- *
997
- * @param options Options for performance calculation.
998
- * @returns The current instance.
999
- */
1000
297
  calculate(options?: PerformanceCalculationOptions): this;
1001
- /**
1002
- * Returns a string representative of the class.
1003
- */
1004
298
  abstract toString(): string;
1005
- /**
1006
- * Calculates all values that will be used for calculating the total
1007
- * performance value of the beatmap and stores them in this instance.
1008
- */
1009
299
  protected abstract calculateValues(): void;
1010
- /**
1011
- * Calculates the total performance value of the beatmap and stores it in this instance.
1012
- */
1013
300
  protected abstract calculateTotalValue(): number;
1014
- /**
1015
- * The total hits that can be done in the beatmap.
1016
- */
1017
301
  protected get totalHits(): number;
1018
- /**
1019
- * The total hits that were successfully done.
1020
- */
1021
302
  protected get totalSuccessfulHits(): number;
1022
- /**
1023
- * Calculates the base performance value of a star rating.
1024
- */
1025
303
  protected baseValue(stars: number): number;
1026
- /**
1027
- * Processes given options for usage in performance calculation.
1028
- *
1029
- * @param options Options for performance calculation.
1030
- */
1031
304
  protected handleOptions(options?: PerformanceCalculationOptions): void;
1032
- /**
1033
- * Calculates the amount of misses + sliderbreaks from combo.
1034
- */
1035
305
  private calculateEffectiveMissCount;
1036
- /**
1037
- * Determines whether an attribute is a cacheable attribute.
1038
- *
1039
- * @param attributes The attributes to check.
1040
- * @returns Whether the attributes are cacheable.
1041
- */
1042
306
  private isCacheableAttribute;
1043
307
  }
1044
308
 
1045
- /**
1046
- * A performance points calculator that calculates performance points for osu!droid gamemode.
1047
- */
1048
309
  declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDifficultyAttributes> {
1049
- /**
1050
- * The aim performance value.
1051
- */
1052
310
  aim: number;
1053
- /**
1054
- * The tap performance value.
1055
- */
1056
311
  tap: number;
1057
- /**
1058
- * The accuracy performance value.
1059
- */
1060
312
  accuracy: number;
1061
- /**
1062
- * The flashlight performance value.
1063
- */
1064
313
  flashlight: number;
1065
- /**
1066
- * The visual performance value.
1067
- */
1068
314
  visual: number;
1069
- /**
1070
- * The penalty used to penalize the tap performance value.
1071
- *
1072
- * Can be properly obtained by analyzing the replay associated with the score.
1073
- */
1074
315
  get tapPenalty(): number;
1075
- /**
1076
- * The estimated deviation of the score.
1077
- */
1078
316
  get deviation(): number;
1079
- /**
1080
- * The estimated tap deviation of the score.
1081
- */
1082
317
  get tapDeviation(): number;
1083
- /**
1084
- * The penalty used to penalize the aim performance value.
1085
- *
1086
- * Can be properly obtained by analyzing the replay associated with the score.
1087
- */
1088
318
  get aimSliderCheesePenalty(): number;
1089
- /**
1090
- * The penalty used to penalize the flashlight performance value.
1091
- *
1092
- * Can be properly obtained by analyzing the replay associated with the score.
1093
- */
1094
319
  get flashlightSliderCheesePenalty(): number;
1095
- /**
1096
- * The penalty used to penalize the visual performance value.
1097
- *
1098
- * Can be properly obtained by analyzing the replay associated with the score.
1099
- */
1100
320
  get visualSliderCheesePenalty(): number;
1101
321
  protected finalMultiplier: number;
1102
322
  protected readonly mode: Modes;
@@ -1106,110 +326,26 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDiff
1106
326
  private _tapPenalty;
1107
327
  private _deviation;
1108
328
  private _tapDeviation;
1109
- /**
1110
- * Applies a tap penalty value to this calculator.
1111
- *
1112
- * The tap and total performance value will be recalculated afterwards.
1113
- *
1114
- * @param value The tap penalty value. Must be greater than or equal to 1.
1115
- */
1116
329
  applyTapPenalty(value: number): void;
1117
- /**
1118
- * Applies an aim slider cheese penalty value to this calculator.
1119
- *
1120
- * The aim and total performance value will be recalculated afterwards.
1121
- *
1122
- * @param value The slider cheese penalty value. Must be between than 0 and 1.
1123
- */
1124
330
  applyAimSliderCheesePenalty(value: number): void;
1125
- /**
1126
- * Applies a flashlight slider cheese penalty value to this calculator.
1127
- *
1128
- * The flashlight and total performance value will be recalculated afterwards.
1129
- *
1130
- * @param value The slider cheese penalty value. Must be between 0 and 1.
1131
- */
1132
331
  applyFlashlightSliderCheesePenalty(value: number): void;
1133
- /**
1134
- * Applies a visual slider cheese penalty value to this calculator.
1135
- *
1136
- * The visual and total performance value will be recalculated afterwards.
1137
- *
1138
- * @param value The slider cheese penalty value. Must be between 0 and 1.
1139
- */
1140
332
  applyVisualSliderCheesePenalty(value: number): void;
1141
333
  protected calculateValues(): void;
1142
334
  protected calculateTotalValue(): number;
1143
335
  protected handleOptions(options?: PerformanceCalculationOptions): void;
1144
- /**
1145
- * Calculates the aim performance value of the beatmap.
1146
- */
1147
336
  private calculateAimValue;
1148
- /**
1149
- * Calculates the tap performance value of the beatmap.
1150
- */
1151
337
  private calculateTapValue;
1152
- /**
1153
- * Calculates the accuracy performance value of the beatmap.
1154
- */
1155
338
  private calculateAccuracyValue;
1156
- /**
1157
- * Calculates the flashlight performance value of the beatmap.
1158
- */
1159
339
  private calculateFlashlightValue;
1160
- /**
1161
- * Calculates the visual performance value of the beatmap.
1162
- */
1163
340
  private calculateVisualValue;
1164
- /**
1165
- * Calculates a strain-based miss penalty.
1166
- *
1167
- * Strain-based miss penalty assumes that a player will miss on the hardest parts of a map,
1168
- * so we use the amount of relatively difficult sections to adjust miss penalty
1169
- * to make it more punishing on maps with lower amount of hard sections.
1170
- */
1171
341
  private calculateStrainBasedMissPenalty;
1172
- /**
1173
- * The object-based proportional miss penalty.
1174
- */
1175
342
  private get proportionalMissPenalty();
1176
- /**
1177
- * Calculates the object-based length scaling based on the deviation of a player for a full
1178
- * combo in this beatmap, taking retries into account.
1179
- *
1180
- * @param objectCount The amount of objects to be considered. Defaults to the amount of
1181
- * objects in this beatmap.
1182
- * @param punishForMemorization Whether to punish the deviation for memorization. Defaults to `false`.
1183
- */
1184
343
  private calculateDeviationBasedLengthScaling;
1185
- /**
1186
- * Estimates the player's tap deviation based on the OD, number of circles and sliders,
1187
- * and number of 300s, 100s, 50s, and misses, assuming the player's mean hit error is 0.
1188
- *
1189
- * The estimation is consistent in that two SS scores on the same map
1190
- * with the same settings will always return the same deviation.
1191
- *
1192
- * Sliders are treated as circles with a 50 hit window.
1193
- *
1194
- * Misses are ignored because they are usually due to misaiming, and 50s
1195
- * are grouped with 100s since they are usually due to misreading.
1196
- *
1197
- * Inaccuracies are capped to the number of circles in the map.
1198
- */
1199
344
  private calculateDeviation;
1200
- /**
1201
- * Does the same as {@link calculateDeviation}, but only for notes and inaccuracies that are relevant to tap difficulty.
1202
- *
1203
- * Treats all difficult speed notes as circles, so this method can sometimes return a lower deviation than {@link calculateDeviation}.
1204
- * This is fine though, since this method is only used to scale tap pp.
1205
- */
1206
345
  private calculateTapDeviation;
1207
346
  toString(): string;
1208
347
  }
1209
348
 
1210
- /**
1211
- * Represents the skill required to properly follow a beatmap's rhythm.
1212
- */
1213
349
  declare class DroidRhythm extends DroidSkill {
1214
350
  protected readonly reducedSectionCount: number;
1215
351
  protected readonly reducedSectionBaseline: number;
@@ -1224,33 +360,15 @@ declare class DroidRhythm extends DroidSkill {
1224
360
  protected saveToHitObject(current: DroidDifficultyHitObject): void;
1225
361
  }
1226
362
 
1227
- /**
1228
- * An evaluator for calculating rhythm skill.
1229
- *
1230
- * This class should be considered an "evaluating" class and not persisted.
1231
- */
1232
363
  declare abstract class RhythmEvaluator {
1233
364
  protected static readonly rhythmMultiplier: number;
1234
365
  protected static readonly historyTimeMax: number;
1235
366
  }
1236
367
 
1237
- /**
1238
- * An evaluator for calculating osu!droid Rhythm skill.
1239
- */
1240
368
  declare abstract class DroidRhythmEvaluator extends RhythmEvaluator {
1241
- /**
1242
- * Calculates a rhythm multiplier for the difficulty of the tap associated
1243
- * with historic data of the current object.
1244
- *
1245
- * @param current The current object.
1246
- * @param greatWindow The great hit window of the current object.
1247
- */
1248
369
  static evaluateDifficultyOf(current: DroidDifficultyHitObject, greatWindow: number): number;
1249
370
  }
1250
371
 
1251
- /**
1252
- * Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
1253
- */
1254
372
  declare class DroidTap extends DroidSkill {
1255
373
  protected readonly reducedSectionCount: number;
1256
374
  protected readonly reducedSectionBaseline: number;
@@ -1264,42 +382,17 @@ declare class DroidTap extends DroidSkill {
1264
382
  constructor(mods: Mod[], overallDifficulty: number, considerCheesability: boolean);
1265
383
  protected strainValueAt(current: DroidDifficultyHitObject): number;
1266
384
  protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
1267
- /**
1268
- * @param current The hitobject to save to.
1269
- */
1270
385
  protected saveToHitObject(current: DroidDifficultyHitObject): void;
1271
386
  }
1272
387
 
1273
- /**
1274
- * An evaluator for calculating speed or tap skill.
1275
- *
1276
- * This class should be considered an "evaluating" class and not persisted.
1277
- */
1278
388
  declare abstract class SpeedEvaluator {
1279
389
  protected static readonly minSpeedBonus: number;
1280
390
  }
1281
391
 
1282
- /**
1283
- * An evaluator for calculating osu!droid tap skill.
1284
- */
1285
392
  declare abstract class DroidTapEvaluator extends SpeedEvaluator {
1286
- /**
1287
- * Evaluates the difficulty of tapping the current object, based on:
1288
- *
1289
- * - time between pressing the previous and current object,
1290
- * - distance between those objects,
1291
- * - and how easily they can be cheesed.
1292
- *
1293
- * @param current The current object.
1294
- * @param greatWindow The great hit window of the current object.
1295
- * @param considerCheesability Whether to consider cheesability.
1296
- */
1297
393
  static evaluateDifficultyOf(current: DroidDifficultyHitObject, greatWindow: number, considerCheesability: boolean): number;
1298
394
  }
1299
395
 
1300
- /**
1301
- * Represents the skill required to read every object in the map.
1302
- */
1303
396
  declare class DroidVisual extends DroidSkill {
1304
397
  protected readonly starsPerDouble: number;
1305
398
  protected readonly reducedSectionCount: number;
@@ -1316,81 +409,26 @@ declare class DroidVisual extends DroidSkill {
1316
409
  protected saveToHitObject(current: DroidDifficultyHitObject): void;
1317
410
  }
1318
411
 
1319
- /**
1320
- * An evaluator for calculating osu!droid Visual skill.
1321
- */
1322
412
  declare abstract class DroidVisualEvaluator {
1323
- /**
1324
- * Evaluates the difficulty of reading the current object, based on:
1325
- *
1326
- * - note density of the current object,
1327
- * - overlapping factor of the current object,
1328
- * - the preempt time of the current object,
1329
- * - the visual opacity of the current object,
1330
- * - the velocity of the current object if it's a slider,
1331
- * - past objects' velocity if they are sliders,
1332
- * - and whether the Hidden mod is enabled.
1333
- *
1334
- * @param current The current object.
1335
- * @param isHiddenMod Whether the Hidden mod is enabled.
1336
- * @param withSliders Whether to take slider difficulty into account.
1337
- */
1338
413
  static evaluateDifficultyOf(current: DroidDifficultyHitObject, isHiddenMod: boolean, withSliders: boolean): number;
1339
414
  }
1340
415
 
1341
- /**
1342
- * Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
1343
- * and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
1344
- */
1345
416
  declare abstract class OsuSkill extends StrainSkill {
1346
- /**
1347
- * The default multiplier applied to the final difficulty value after all other calculations.
1348
- *
1349
- * May be overridden via {@link difficultyMultiplier}.
1350
- */
1351
417
  static readonly defaultDifficultyMultiplier: number;
1352
- /**
1353
- * The final multiplier to be applied to the final difficulty value after all other calculations.
1354
- */
1355
418
  protected readonly difficultyMultiplier: number;
1356
- /**
1357
- * The weight by which each strain value decays.
1358
- */
1359
419
  protected abstract readonly decayWeight: number;
1360
420
  difficultyValue(): number;
1361
421
  }
1362
422
 
1363
- /**
1364
- * Represents an osu!standard hit object with difficulty calculation values.
1365
- */
1366
423
  declare class OsuDifficultyHitObject extends DifficultyHitObject {
1367
- /**
1368
- * The speed strain generated by the hitobject.
1369
- */
1370
424
  speedStrain: number;
1371
- /**
1372
- * The flashlight strain generated by this hitobject.
1373
- */
1374
425
  flashlightStrain: number;
1375
426
  private readonly radiusBuffThreshold;
1376
427
  protected readonly mode = Modes.osu;
1377
428
  protected get scalingFactor(): number;
1378
- /**
1379
- * Note: You **must** call `computeProperties` at some point due to how TypeScript handles
1380
- * overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue.).
1381
- *
1382
- * @param object The underlying hitobject.
1383
- * @param lastObject The hitobject before this hitobject.
1384
- * @param lastLastObject The hitobject before the last hitobject.
1385
- * @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
1386
- * @param clockRate The clock rate of the beatmap.
1387
- */
1388
429
  constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number);
1389
430
  }
1390
431
 
1391
- /**
1392
- * Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
1393
- */
1394
432
  declare class OsuAim extends OsuSkill {
1395
433
  protected readonly strainDecayBase: number;
1396
434
  protected readonly reducedSectionCount: number;
@@ -1402,71 +440,27 @@ declare class OsuAim extends OsuSkill {
1402
440
  constructor(mods: Mod[], withSliders: boolean);
1403
441
  protected strainValueAt(current: OsuDifficultyHitObject): number;
1404
442
  protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
1405
- /**
1406
- * @param current The hitobject to save to.
1407
- */
1408
443
  protected saveToHitObject(current: OsuDifficultyHitObject): void;
1409
444
  }
1410
445
 
1411
- /**
1412
- * An evaluator for calculating osu!standard Aim skill.
1413
- */
1414
446
  declare abstract class OsuAimEvaluator extends AimEvaluator {
1415
- /**
1416
- * Evaluates the difficulty of aiming the current object, based on:
1417
- *
1418
- * - cursor velocity to the current object,
1419
- * - angle difficulty,
1420
- * - sharp velocity increases,
1421
- * - and slider difficulty.
1422
- *
1423
- * @param current The current object.
1424
- * @param withSliders Whether to take slider difficulty into account.
1425
- */
1426
447
  static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
1427
448
  }
1428
449
 
1429
- /**
1430
- * Holds data that can be used to calculate osu!standard performance points.
1431
- */
1432
450
  interface OsuDifficultyAttributes extends DifficultyAttributes {
1433
- /**
1434
- * The difficulty corresponding to the speed skill.
1435
- */
1436
451
  speedDifficulty: number;
1437
452
  }
1438
453
 
1439
- /**
1440
- * A difficulty calculator for osu!standard gamemode.
1441
- */
1442
454
  declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficultyHitObject, OsuDifficultyAttributes> {
1443
- /**
1444
- * The aim star rating of the beatmap.
1445
- */
1446
455
  get aim(): number;
1447
- /**
1448
- * The speed star rating of the beatmap.
1449
- */
1450
456
  get speed(): number;
1451
- /**
1452
- * The flashlight star rating of the beatmap.
1453
- */
1454
457
  get flashlight(): number;
1455
458
  readonly attributes: OsuDifficultyAttributes;
1456
459
  get cacheableAttributes(): CacheableDifficultyAttributes<OsuDifficultyAttributes>;
1457
460
  protected readonly difficultyMultiplier = 0.0675;
1458
461
  protected readonly mode = Modes.osu;
1459
- /**
1460
- * Calculates the aim star rating of the beatmap and stores it in this instance.
1461
- */
1462
462
  calculateAim(): void;
1463
- /**
1464
- * Calculates the speed star rating of the beatmap and stores it in this instance.
1465
- */
1466
463
  calculateSpeed(): void;
1467
- /**
1468
- * Calculates the flashlight star rating of the beatmap and stores it in this instance.
1469
- */
1470
464
  calculateFlashlight(): void;
1471
465
  calculateTotal(): void;
1472
466
  calculateAll(): void;
@@ -1474,34 +468,12 @@ declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficulty
1474
468
  protected generateDifficultyHitObjects(): OsuDifficultyHitObject[];
1475
469
  protected computeDifficultyStatistics(options?: DifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
1476
470
  protected createSkills(): OsuSkill[];
1477
- /**
1478
- * Called after aim skill calculation.
1479
- *
1480
- * @param aimSkill The aim skill that considers sliders.
1481
- * @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
1482
- */
1483
471
  private postCalculateAim;
1484
- /**
1485
- * Called after speed skill calculation.
1486
- *
1487
- * @param speedSkill The speed skill.
1488
- */
1489
472
  private postCalculateSpeed;
1490
- /**
1491
- * Calculates speed-related attributes.
1492
- */
1493
473
  private calculateSpeedAttributes;
1494
- /**
1495
- * Called after flashlight skill calculation.
1496
- *
1497
- * @param flashlightSkill The flashlight skill.
1498
- */
1499
474
  private postCalculateFlashlight;
1500
475
  }
1501
476
 
1502
- /**
1503
- * Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
1504
- */
1505
477
  declare class OsuFlashlight extends OsuSkill {
1506
478
  protected readonly strainDecayBase: number;
1507
479
  protected readonly reducedSectionCount: number;
@@ -1516,85 +488,30 @@ declare class OsuFlashlight extends OsuSkill {
1516
488
  protected saveToHitObject(current: OsuDifficultyHitObject): void;
1517
489
  }
1518
490
 
1519
- /**
1520
- * An evaluator for calculating osu!standard Flashlight skill.
1521
- */
1522
491
  declare abstract class OsuFlashlightEvaluator extends FlashlightEvaluator {
1523
- /**
1524
- * Evaluates the difficulty of memorizing and hitting the current object, based on:
1525
- *
1526
- * - distance between a number of previous objects and the current object,
1527
- * - the visual opacity of the current object,
1528
- * - the angle made by the current object,
1529
- * - length and speed of the current object (for sliders),
1530
- * - and whether Hidden mod is enabled.
1531
- *
1532
- * @param current The current object.
1533
- * @param isHiddenMod Whether the Hidden mod is enabled.
1534
- */
1535
492
  static evaluateDifficultyOf(current: OsuDifficultyHitObject, isHiddenMod: boolean): number;
1536
493
  }
1537
494
 
1538
- /**
1539
- * A performance points calculator that calculates performance points for osu!standard gamemode.
1540
- */
1541
495
  declare class OsuPerformanceCalculator extends PerformanceCalculator<OsuDifficultyAttributes> {
1542
- /**
1543
- * The aim performance value.
1544
- */
1545
496
  aim: number;
1546
- /**
1547
- * The speed performance value.
1548
- */
1549
497
  speed: number;
1550
- /**
1551
- * The accuracy performance value.
1552
- */
1553
498
  accuracy: number;
1554
- /**
1555
- * The flashlight performance value.
1556
- */
1557
499
  flashlight: number;
1558
500
  protected finalMultiplier: number;
1559
501
  protected readonly mode: Modes;
1560
502
  protected calculateValues(): void;
1561
503
  protected calculateTotalValue(): number;
1562
- /**
1563
- * Calculates the aim performance value of the beatmap.
1564
- */
1565
504
  private calculateAimValue;
1566
- /**
1567
- * Calculates the speed performance value of the beatmap.
1568
- */
1569
505
  private calculateSpeedValue;
1570
- /**
1571
- * Calculates the accuracy performance value of the beatmap.
1572
- */
1573
506
  private calculateAccuracyValue;
1574
- /**
1575
- * Calculates the flashlight performance value of the beatmap.
1576
- */
1577
507
  private calculateFlashlightValue;
1578
508
  toString(): string;
1579
509
  }
1580
510
 
1581
- /**
1582
- * An evaluator for calculating osu!standard Rhythm skill.
1583
- */
1584
511
  declare abstract class OsuRhythmEvaluator extends RhythmEvaluator {
1585
- /**
1586
- * Calculates a rhythm multiplier for the difficulty of the tap associated
1587
- * with historic data of the current object.
1588
- *
1589
- * @param current The current object.
1590
- * @param greatWindow The great hit window of the current object.
1591
- */
1592
512
  static evaluateDifficultyOf(current: OsuDifficultyHitObject, greatWindow: number): number;
1593
513
  }
1594
514
 
1595
- /**
1596
- * Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
1597
- */
1598
515
  declare class OsuSpeed extends OsuSkill {
1599
516
  protected readonly strainDecayBase = 0.3;
1600
517
  protected readonly reducedSectionCount = 5;
@@ -1606,35 +523,13 @@ declare class OsuSpeed extends OsuSkill {
1606
523
  private readonly skillMultiplier;
1607
524
  private readonly greatWindow;
1608
525
  constructor(mods: Mod[], overallDifficulty: number);
1609
- /**
1610
- * @param current The hitobject to calculate.
1611
- */
1612
526
  protected strainValueAt(current: OsuDifficultyHitObject): number;
1613
527
  protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
1614
- /**
1615
- * @param current The hitobject to save to.
1616
- */
1617
528
  protected saveToHitObject(current: OsuDifficultyHitObject): void;
1618
529
  }
1619
530
 
1620
- /**
1621
- * An evaluator for calculating osu!standard speed skill.
1622
- */
1623
531
  declare abstract class OsuSpeedEvaluator extends SpeedEvaluator {
1624
- /**
1625
- * Spacing threshold for a single hitobject spacing.
1626
- */
1627
532
  private static readonly SINGLE_SPACING_THRESHOLD;
1628
- /**
1629
- * Evaluates the difficulty of tapping the current object, based on:
1630
- *
1631
- * - time between pressing the previous and current object,
1632
- * - distance between those objects,
1633
- * - and how easily they can be cheesed.
1634
- *
1635
- * @param current The current object.
1636
- * @param greatWindow The great hit window of the current object.
1637
- */
1638
533
  static evaluateDifficultyOf(current: OsuDifficultyHitObject, greatWindow: number): number;
1639
534
  }
1640
535