@rian8337/osu-difficulty-calculator 4.0.0-beta.52 → 4.0.0-beta.55

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.
Files changed (3) hide show
  1. package/dist/index.js +788 -950
  2. package/package.json +3 -3
  3. package/typings/index.d.ts +256 -343
@@ -1,9 +1,9 @@
1
- import { Mod, PlaceableHitObject, Modes, Beatmap, Accuracy } from '@rian8337/osu-base';
1
+ import { Mod, SerializedMod, PlaceableHitObject, Modes, PlayableBeatmap, Beatmap, DroidPlayableBeatmap, Accuracy, OsuPlayableBeatmap } from '@rian8337/osu-base';
2
2
 
3
3
  /**
4
4
  * Holds data that can be used to calculate performance points.
5
5
  */
6
- interface DifficultyAttributes {
6
+ interface IDifficultyAttributes {
7
7
  /**
8
8
  * The mods which were applied to the beatmap.
9
9
  */
@@ -73,25 +73,42 @@ interface DifficultyAttributes {
73
73
  /**
74
74
  * Represents difficulty attributes that can be cached.
75
75
  */
76
- type CacheableDifficultyAttributes<T extends DifficultyAttributes> = Omit<T, "mods"> & {
76
+ type CacheableDifficultyAttributes<T extends IDifficultyAttributes> = Omit<T, "mods"> & {
77
77
  /**
78
78
  * The mods which were applied to the beatmap.
79
79
  */
80
- mods: string;
80
+ mods: SerializedMod[];
81
81
  };
82
82
 
83
83
  /**
84
- * Represents options for difficulty calculation.
84
+ * Holds data that can be used to calculate performance points.
85
85
  */
86
- interface DifficultyCalculationOptions {
86
+ declare abstract class DifficultyAttributes implements IDifficultyAttributes {
87
+ mods: Mod[];
88
+ starRating: number;
89
+ maxCombo: number;
90
+ aimDifficulty: number;
91
+ flashlightDifficulty: number;
92
+ speedNoteCount: number;
93
+ sliderFactor: number;
94
+ clockRate: number;
95
+ overallDifficulty: number;
96
+ hitCircleCount: number;
97
+ sliderCount: number;
98
+ spinnerCount: number;
99
+ aimDifficultSliderCount: number;
100
+ aimDifficultStrainCount: number;
101
+ constructor(cacheableAttributes?: CacheableDifficultyAttributes<IDifficultyAttributes>);
87
102
  /**
88
- * The modifications to apply.
103
+ * Converts this `DifficultyAttributes` instance to an attribute structure that can be cached.
104
+ *
105
+ * @returns The cacheable attributes.
89
106
  */
90
- readonly mods?: Mod[];
107
+ toCacheableAttributes(): CacheableDifficultyAttributes<IDifficultyAttributes>;
91
108
  /**
92
- * The custom speed multiplier to apply. Defaults to 1.
109
+ * Returns a string representation of the difficulty attributes.
93
110
  */
94
- readonly customSpeedMultiplier?: number;
111
+ toString(): string;
95
112
  }
96
113
 
97
114
  /**
@@ -208,7 +225,7 @@ declare abstract class DifficultyHitObject {
208
225
  * @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
209
226
  * @param clockRate The clock rate of the beatmap.
210
227
  */
211
- constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number);
228
+ constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
212
229
  /**
213
230
  * Computes the properties of this hitobject.
214
231
  *
@@ -245,7 +262,7 @@ declare abstract class DifficultyHitObject {
245
262
  * @param mods The mods used.
246
263
  * @returns The opacity of the hitobject at the given time.
247
264
  */
248
- opacityAt(time: number, mods: Mod[]): number;
265
+ opacityAt(time: number, mods: readonly Mod[]): number;
249
266
  /**
250
267
  * How possible is it to doubletap this object together with the next one and get perfect
251
268
  * judgement in range from 0 to 1.
@@ -259,28 +276,6 @@ declare abstract class DifficultyHitObject {
259
276
  private getEndCursorPosition;
260
277
  }
261
278
 
262
- /**
263
- * Represents the strain peaks of various calculated difficulties.
264
- */
265
- interface StrainPeaks {
266
- /**
267
- * The strain peaks of aim difficulty if sliders are considered.
268
- */
269
- aimWithSliders: number[];
270
- /**
271
- * The strain peaks of aim difficulty if sliders are not considered.
272
- */
273
- aimWithoutSliders: number[];
274
- /**
275
- * The strain peaks of speed difficulty.
276
- */
277
- speed: number[];
278
- /**
279
- * The strain peaks of flashlight difficulty.
280
- */
281
- flashlight: number[];
282
- }
283
-
284
279
  /**
285
280
  * A bare minimal abstract skill for fully custom skill implementations.
286
281
  *
@@ -290,8 +285,8 @@ declare abstract class Skill {
290
285
  /**
291
286
  * The mods that this skill processes.
292
287
  */
293
- protected readonly mods: Mod[];
294
- constructor(mods: Mod[]);
288
+ protected readonly mods: readonly Mod[];
289
+ constructor(mods: readonly Mod[]);
295
290
  /**
296
291
  * Processes a hitobject.
297
292
  *
@@ -305,140 +300,25 @@ declare abstract class Skill {
305
300
  }
306
301
 
307
302
  /**
308
- * The base of a difficulty calculator.
303
+ * Represents the strain peaks of various calculated difficulties.
309
304
  */
310
- declare abstract class DifficultyCalculator<THitObject extends DifficultyHitObject, TAttributes extends DifficultyAttributes> {
311
- /**
312
- * The calculated beatmap.
313
- */
314
- readonly beatmap: Beatmap;
315
- /**
316
- * The difficulty objects of the beatmap.
317
- */
318
- private _objects;
319
- /**
320
- * The difficulty objects of the beatmap.
321
- */
322
- get objects(): readonly THitObject[];
323
- /**
324
- * The modifications applied.
325
- */
326
- mods: Mod[];
327
- /**
328
- * The total star rating of the beatmap.
329
- */
330
- get total(): number;
331
- /**
332
- * The strain peaks of various calculated difficulties.
333
- */
334
- readonly strainPeaks: StrainPeaks;
335
- /**
336
- * The difficulty attributes that can be used to calculate performance points.
337
- */
338
- abstract readonly attributes: TAttributes;
339
- /**
340
- * The difficulty attributes that can be cached. It can also be used to calculate performance points.
341
- */
342
- abstract get cacheableAttributes(): CacheableDifficultyAttributes<TAttributes>;
343
- protected abstract readonly difficultyMultiplier: number;
344
- protected abstract readonly mode: Modes;
345
- /**
346
- * Constructs a new instance of the calculator.
347
- *
348
- * @param beatmap The beatmap to calculate.
349
- */
350
- 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
- calculate(options?: DifficultyCalculationOptions): this;
367
- /**
368
- * Generates difficulty hitobjects for this calculator.
369
- *
370
- * @param beatmap The beatmap to generate difficulty hitobjects from.
371
- * @param clockRate The clock rate of the beatmap.
372
- */
373
- protected abstract generateDifficultyHitObjects(beatmap: Beatmap, clockRate: number): THitObject[];
374
- /**
375
- * Calculates the skills provided.
376
- *
377
- * @param skills The skills to calculate.
378
- */
379
- protected calculateSkills(...skills: Skill[]): void;
380
- /**
381
- * Calculates the total star rating of the beatmap and stores it in this instance.
382
- */
383
- abstract calculateTotal(): void;
384
- /**
385
- * Calculates every star rating of the beatmap and stores it in this instance.
386
- */
387
- abstract calculateAll(): void;
388
- /**
389
- * Returns a string representative of the class.
390
- */
391
- abstract toString(): string;
392
- /**
393
- * Creates skills to be calculated.
394
- */
395
- protected abstract createSkills(): Skill[];
396
- /**
397
- * Obtains the clock rate of the beatmap.
398
- *
399
- * @param options The options to obtain the clock rate with.
400
- * @returns The clock rate of the beatmap.
401
- */
402
- protected calculateClockRate(options?: DifficultyCalculationOptions): number;
403
- /**
404
- * Populates the stored difficulty attributes with necessary data.
405
- *
406
- * @param beatmap The beatmap to populate the attributes with.
407
- * @param clockRate The clock rate of the beatmap.
408
- */
409
- protected populateDifficultyAttributes(beatmap: Beatmap, clockRate: number): void;
305
+ interface StrainPeaks {
410
306
  /**
411
- * Calculates the star rating value of a difficulty.
412
- *
413
- * @param difficulty The difficulty to calculate.
307
+ * The strain peaks of aim difficulty if sliders are considered.
414
308
  */
415
- protected starValue(difficulty: number): number;
309
+ aimWithSliders: number[];
416
310
  /**
417
- * Calculates the base performance value of a difficulty rating.
418
- *
419
- * @param rating The difficulty rating.
311
+ * The strain peaks of aim difficulty if sliders are not considered.
420
312
  */
421
- protected basePerformanceValue(rating: number): number;
422
- }
423
-
424
- /**
425
- * Represents a slider that is considered difficult.
426
- *
427
- * This structure is a part of difficulty attributes and can be cached.
428
- */
429
- interface DifficultSlider {
313
+ aimWithoutSliders: number[];
430
314
  /**
431
- * The index of the slider in the beatmap.
315
+ * The strain peaks of speed difficulty.
432
316
  */
433
- readonly index: number;
317
+ speed: number[];
434
318
  /**
435
- * The difficulty rating of this slider compared to other sliders, based on the velocity of the slider.
436
- *
437
- * A value closer to 1 indicates that this slider is more difficult compared to most sliders.
438
- *
439
- * A value closer to 0 indicates that this slider is easier compared to most sliders.
319
+ * The strain peaks of flashlight difficulty.
440
320
  */
441
- readonly difficultyRating: number;
321
+ flashlight: number[];
442
322
  }
443
323
 
444
324
  /**
@@ -526,6 +406,124 @@ declare abstract class StrainSkill extends Skill {
526
406
  private startNewSectionFrom;
527
407
  }
528
408
 
409
+ /**
410
+ * The base of a difficulty calculator.
411
+ */
412
+ declare abstract class DifficultyCalculator<TBeatmap extends PlayableBeatmap, THitObject extends DifficultyHitObject, TAttributes extends DifficultyAttributes> {
413
+ protected abstract readonly difficultyMultiplier: number;
414
+ /**
415
+ * `Mod`s that adjust the difficulty of a beatmap.
416
+ */
417
+ protected readonly difficultyAdjustmentMods: Set<typeof Mod>;
418
+ /**
419
+ * Retains `Mod`s that adjust a beatmap's difficulty from the specified mods.
420
+ *
421
+ * @param mods The mods to retain the difficulty adjustment mods from.
422
+ * @returns The retained difficulty adjustment mods.
423
+ */
424
+ abstract retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
425
+ /**
426
+ * Calculates the difficulty of a `PlayableBeatmap`.
427
+ *
428
+ * @param beatmap The `PlayableBeatmap` whose difficulty is to be calculated.
429
+ * @returns A `DifficultyAttributes` object describing the difficulty of the `Beatmap`.
430
+ */
431
+ calculate(beatmap: TBeatmap): TAttributes;
432
+ /**
433
+ * Calculates the difficulty of a `Beatmap` with specific `Mod`s.
434
+ *
435
+ * @param beatmap The `Beatmap` whose difficulty is to be calculated.
436
+ * @param mods The `Mod`s to apply to the beatmap. Defaults to No Mod.
437
+ * @returns A `DifficultyAttributes` object describing the difficulty of the `Beatmap`.
438
+ */
439
+ calculate(beatmap: Beatmap, mods?: Mod[]): TAttributes;
440
+ /**
441
+ * Obtains the strain peaks of a `PlayableBeatmap`.
442
+ *
443
+ * @param beatmap The `PlayableBeatmap` whose strain peaks are to be calculated.
444
+ * @returns The strain peaks of the `PlayableBeatmap`.
445
+ */
446
+ calculateStrainPeaks(beatmap: TBeatmap): StrainPeaks;
447
+ /**
448
+ * Obtains the strain peaks of a `Beatmap` with specific `Mod`s.
449
+ *
450
+ * @param beatmap The `Beatmap` whose strain peaks are to be calculated.
451
+ * @param mods The `Mod`s to apply to the beatmap. Defaults to No Mod.
452
+ * @returns The strain peaks of the `Beatmap`.
453
+ */
454
+ calculateStrainPeaks(beatmap: Beatmap, mods: Mod[]): StrainPeaks;
455
+ /**
456
+ * Creates the `Skill`s to calculate the difficulty of a `PlayableBeatmap`.
457
+ *
458
+ * @param beatmap The `PlayableBeatmap` whose difficulty will be calculated.
459
+ * @return The `Skill`s.
460
+ */
461
+ protected abstract createSkills(beatmap: TBeatmap): Skill[];
462
+ /**
463
+ * Creates the `Skill`s to obtain the strain peaks of a `PlayableBeatmap`.
464
+ *
465
+ * @param beatmap
466
+ */
467
+ protected abstract createStrainPeakSkills(beatmap: TBeatmap): StrainSkill[];
468
+ /**
469
+ * Creates difficulty hitobjects for this calculator.
470
+ *
471
+ * @param beatmap The beatmap to generate difficulty hitobjects from.
472
+ * @returns The generated difficulty hitobjects.
473
+ */
474
+ protected abstract createDifficultyHitObjects(beatmap: TBeatmap): THitObject[];
475
+ /**
476
+ * Creates a `DifficultyAttributes` object to describe a `PlayableBeatmap`'s difficulty.
477
+ *
478
+ * @param beatmap The `PlayableBeatmap` whose difficulty was calculated.
479
+ * @param skills The `Skill`s which processed the `PlayableBeatmap`.
480
+ * @param objects The `DifficultyHitObject`s which were processed.
481
+ * @returns The `DifficultyAttributes` object.
482
+ */
483
+ protected abstract createDifficultyAttributes(beatmap: TBeatmap, skills: Skill[], objects: THitObject[]): TAttributes;
484
+ /**
485
+ * Constructs a `PlayableBeatmap` from a `Beatmap` with specific `Mod`s.
486
+ *
487
+ * @param beatmap The `Beatmap` to create a `PlayableBeatmap` from.
488
+ * @param mods The `Mod`s to apply to the `Beatmap`.
489
+ * @returns The `PlayableBeatmap`.
490
+ */
491
+ protected abstract createPlayableBeatmap(beatmap: Beatmap, mods: Mod[]): TBeatmap;
492
+ /**
493
+ * Calculates the base rating of a `Skill`.
494
+ *
495
+ * @param skill The `Skill` to calculate the rating of.
496
+ * @returns The rating of the `Skill`.
497
+ */
498
+ protected calculateRating(skill: Skill): number;
499
+ /**
500
+ * Calculates the base performance value of a difficulty rating.
501
+ *
502
+ * @param rating The difficulty rating.
503
+ */
504
+ protected basePerformanceValue(rating: number): number;
505
+ }
506
+
507
+ /**
508
+ * Represents a slider that is considered difficult.
509
+ *
510
+ * This structure is a part of difficulty attributes and can be cached.
511
+ */
512
+ interface DifficultSlider {
513
+ /**
514
+ * The index of the slider in the beatmap.
515
+ */
516
+ readonly index: number;
517
+ /**
518
+ * The difficulty rating of this slider compared to other sliders, based on the velocity of the slider.
519
+ *
520
+ * A value closer to 1 indicates that this slider is more difficult compared to most sliders.
521
+ *
522
+ * A value closer to 0 indicates that this slider is easier compared to most sliders.
523
+ */
524
+ readonly difficultyRating: number;
525
+ }
526
+
529
527
  /**
530
528
  * Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
531
529
  * and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
@@ -608,9 +606,11 @@ declare class DroidDifficultyHitObject extends DifficultyHitObject {
608
606
  * @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
609
607
  * @param clockRate The clock rate of the beatmap.
610
608
  */
611
- constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number);
609
+ constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
612
610
  computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
613
- opacityAt(time: number, mods: Mod[]): number;
611
+ opacityAt(time: number, mods: readonly Mod[]): number;
612
+ previous(backwardsIndex: number): this | null;
613
+ next(forwardsIndex: number): this | null;
614
614
  /**
615
615
  * Determines whether this hitobject is considered overlapping with the hitobject before it.
616
616
  *
@@ -640,7 +640,7 @@ declare class DroidAim extends DroidSkill {
640
640
  private currentAimStrain;
641
641
  private readonly sliderStrains;
642
642
  readonly withSliders: boolean;
643
- constructor(mods: Mod[], withSliders: boolean);
643
+ constructor(mods: readonly Mod[], withSliders: boolean);
644
644
  /**
645
645
  * Obtains the amount of sliders that are considered difficult in terms of relative strain.
646
646
  */
@@ -692,7 +692,7 @@ declare abstract class DroidAimEvaluator {
692
692
  /**
693
693
  * Holds data that can be used to calculate osu!droid performance points.
694
694
  */
695
- interface DroidDifficultyAttributes extends DifficultyAttributes {
695
+ interface IDroidDifficultyAttributes extends IDifficultyAttributes {
696
696
  /**
697
697
  * The difficulty corresponding to the tap skill.
698
698
  */
@@ -732,13 +732,19 @@ interface DroidDifficultyAttributes extends DifficultyAttributes {
732
732
  }
733
733
 
734
734
  /**
735
- * Represents options for osu!droid difficulty calculation.
735
+ * Holds data that can be used to calculate osu!droid performance points.
736
736
  */
737
- interface DroidDifficultyCalculationOptions extends DifficultyCalculationOptions {
738
- /**
739
- * Whether to calculate for old statistics (1.6.7 and older). Defaults to `false`.
740
- */
741
- readonly oldStatistics?: boolean;
737
+ declare class DroidDifficultyAttributes extends DifficultyAttributes implements IDroidDifficultyAttributes {
738
+ tapDifficulty: number;
739
+ rhythmDifficulty: number;
740
+ visualDifficulty: number;
741
+ tapDifficultStrainCount: number;
742
+ flashlightDifficultStrainCount: number;
743
+ visualDifficultStrainCount: number;
744
+ averageSpeedDeltaTime: number;
745
+ vibroFactor: number;
746
+ constructor(cacheableAttributes?: CacheableDifficultyAttributes<IDroidDifficultyAttributes>);
747
+ toString(): string;
742
748
  }
743
749
 
744
750
  /**
@@ -763,7 +769,7 @@ interface HighStrainSection {
763
769
  * Holds data that can be used to calculate osu!droid performance points as well
764
770
  * as doing some analysis using the replay of a score.
765
771
  */
766
- interface ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes {
772
+ interface IExtendedDroidDifficultyAttributes extends IDroidDifficultyAttributes {
767
773
  /**
768
774
  * The mode of the difficulty calculation.
769
775
  */
@@ -800,109 +806,43 @@ interface ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes {
800
806
  visualSliderFactor: number;
801
807
  }
802
808
 
809
+ /**
810
+ * Holds data that can be used to calculate osu!droid performance points as well
811
+ * as doing some analysis using the replay of a score.
812
+ */
813
+ declare class ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes implements IExtendedDroidDifficultyAttributes {
814
+ mode: "live";
815
+ possibleThreeFingeredSections: HighStrainSection[];
816
+ difficultSliders: DifficultSlider[];
817
+ aimNoteCount: number;
818
+ flashlightSliderFactor: number;
819
+ visualSliderFactor: number;
820
+ constructor(cacheableAttributes?: CacheableDifficultyAttributes<IExtendedDroidDifficultyAttributes>);
821
+ }
822
+
803
823
  /**
804
824
  * A difficulty calculator for osu!droid gamemode.
805
825
  */
806
- declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDifficultyHitObject, DroidDifficultyAttributes> {
807
- /**
808
- * The aim star rating of the beatmap.
809
- */
810
- get aim(): number;
811
- /**
812
- * The tap star rating of the beatmap.
813
- */
814
- get tap(): number;
815
- /**
816
- * The rhythm star rating of the beatmap.
817
- */
818
- get rhythm(): number;
819
- /**
820
- * The flashlight star rating of the beatmap.
821
- */
822
- get flashlight(): number;
823
- /**
824
- * The visual star rating of the beatmap.
825
- */
826
- get visual(): number;
826
+ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidPlayableBeatmap, DroidDifficultyHitObject, ExtendedDroidDifficultyAttributes> {
827
827
  /**
828
828
  * The strain threshold to start detecting for possible three-fingered section.
829
829
  *
830
830
  * Increasing this number will result in less sections being flagged.
831
831
  */
832
832
  static readonly threeFingerStrainThreshold = 175;
833
- readonly attributes: ExtendedDroidDifficultyAttributes;
834
- get cacheableAttributes(): CacheableDifficultyAttributes<DroidDifficultyAttributes>;
835
833
  protected readonly difficultyMultiplier = 0.18;
836
- protected readonly mode = Modes.droid;
837
- calculate(options?: DroidDifficultyCalculationOptions): this;
838
- /**
839
- * Calculates the aim star rating of the beatmap and stores it in this instance.
840
- */
841
- calculateAim(): void;
842
- /**
843
- * Calculates the tap star rating of the beatmap and stores it in this instance.
844
- */
845
- calculateTap(): void;
846
- /**
847
- * Calculates the rhythm star rating of the beatmap and stores it in this instance.
848
- */
849
- calculateRhythm(): void;
850
- /**
851
- * Calculates the flashlight star rating of the beatmap and stores it in this instance.
852
- */
853
- calculateFlashlight(): void;
854
- /**
855
- * Calculates the visual star rating of the beatmap and stores it in this instance.
856
- */
857
- calculateVisual(): void;
858
- calculateTotal(): void;
859
- calculateAll(): void;
860
- toString(): string;
861
- protected generateDifficultyHitObjects(beatmap: Beatmap, clockRate: number): DroidDifficultyHitObject[];
862
- protected createSkills(): DroidSkill[];
863
- protected calculateClockRate(options?: DroidDifficultyCalculationOptions): number;
864
- /**
865
- * Called after aim skill calculation.
866
- *
867
- * @param aimSkill The aim skill that considers sliders.
868
- * @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
869
- */
870
- private postCalculateAim;
871
- /**
872
- * Calculates aim-related attributes.
873
- */
874
- private calculateAimAttributes;
875
- /**
876
- * Called after tap skill calculation.
877
- *
878
- * @param tapSkillCheese The tap skill that considers cheesing.
879
- * @param tapSkillVibro The tap skill that considers vibro.
880
- */
881
- private postCalculateTap;
882
- /**
883
- * Calculates tap-related attributes.
884
- */
885
- private calculateTapAttributes;
886
- /**
887
- * Called after rhythm skill calculation.
888
- *
889
- * @param rhythmSkill The rhythm skill.
890
- */
891
- private postCalculateRhythm;
892
- /**
893
- * Called after flashlight skill calculation.
894
- *
895
- * @param flashlightSkill The flashlight skill that considers sliders.
896
- * @param flashlightSkillWithoutSliders The flashlight skill that doesn't consider sliders.
897
- */
898
- private postCalculateFlashlight;
899
- /**
900
- * Called after visual skill calculation.
901
- *
902
- * @param visualSkillWithSliders The visual skill that considers sliders.
903
- * @param visualSkillWithoutSliders The visual skill that doesn't consider sliders.
904
- */
905
- private postCalculateVisual;
834
+ constructor();
835
+ retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
836
+ protected createDifficultyAttributes(beatmap: DroidPlayableBeatmap, skills: Skill[], objects: DroidDifficultyHitObject[]): ExtendedDroidDifficultyAttributes;
837
+ protected createPlayableBeatmap(beatmap: Beatmap, mods: Mod[]): DroidPlayableBeatmap;
838
+ protected createDifficultyHitObjects(beatmap: DroidPlayableBeatmap): DroidDifficultyHitObject[];
839
+ protected createSkills(beatmap: DroidPlayableBeatmap): DroidSkill[];
840
+ protected createStrainPeakSkills(beatmap: DroidPlayableBeatmap): StrainSkill[];
841
+ private populateAimAttributes;
842
+ private populateTapAttributes;
843
+ private populateRhythmAttributes;
844
+ private populateFlashlightAttributes;
845
+ private populateVisualAttributes;
906
846
  }
907
847
 
908
848
  /**
@@ -916,7 +856,7 @@ declare class DroidFlashlight extends DroidSkill {
916
856
  private readonly skillMultiplier;
917
857
  private currentFlashlightStrain;
918
858
  readonly withSliders: boolean;
919
- constructor(mods: Mod[], withSliders: boolean);
859
+ constructor(mods: readonly Mod[], withSliders: boolean);
920
860
  protected strainValueAt(current: DroidDifficultyHitObject): number;
921
861
  protected calculateInitialStrain(time: number, current: DifficultyHitObject): number;
922
862
  protected getObjectStrain(): number;
@@ -948,7 +888,7 @@ declare abstract class DroidFlashlightEvaluator {
948
888
  * @param mods The mods used.
949
889
  * @param withSliders Whether to take slider difficulty into account.
950
890
  */
951
- static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: Mod[], withSliders: boolean): number;
891
+ static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: readonly Mod[], withSliders: boolean): number;
952
892
  }
953
893
 
954
894
  /**
@@ -988,7 +928,7 @@ interface PerformanceCalculationOptions {
988
928
  /**
989
929
  * The base class of performance calculators.
990
930
  */
991
- declare abstract class PerformanceCalculator<T extends DifficultyAttributes> {
931
+ declare abstract class PerformanceCalculator<T extends IDifficultyAttributes> {
992
932
  /**
993
933
  * The overall performance value.
994
934
  */
@@ -1093,7 +1033,7 @@ declare abstract class PerformanceCalculator<T extends DifficultyAttributes> {
1093
1033
  /**
1094
1034
  * A performance points calculator that calculates performance points for osu!droid gamemode.
1095
1035
  */
1096
- declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDifficultyAttributes> {
1036
+ declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDifficultyAttributes> {
1097
1037
  /**
1098
1038
  * The aim performance value.
1099
1039
  */
@@ -1259,7 +1199,7 @@ declare class DroidRhythm extends DroidSkill {
1259
1199
  private readonly useSliderAccuracy;
1260
1200
  private currentRhythmStrain;
1261
1201
  private currentRhythmMultiplier;
1262
- constructor(mods: Mod[]);
1202
+ constructor(mods: readonly Mod[]);
1263
1203
  protected strainValueAt(current: DroidDifficultyHitObject): number;
1264
1204
  protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
1265
1205
  protected getObjectStrain(): number;
@@ -1302,7 +1242,7 @@ declare class DroidTap extends DroidSkill {
1302
1242
  get objectDeltaTimes(): readonly number[];
1303
1243
  readonly considerCheesability: boolean;
1304
1244
  private readonly strainTimeCap?;
1305
- constructor(mods: Mod[], considerCheesability: boolean, strainTimeCap?: number);
1245
+ constructor(mods: readonly Mod[], considerCheesability: boolean, strainTimeCap?: number);
1306
1246
  /**
1307
1247
  * The amount of notes that are relevant to the difficulty.
1308
1248
  */
@@ -1353,7 +1293,7 @@ declare class DroidVisual extends DroidSkill {
1353
1293
  private currentRhythmMultiplier;
1354
1294
  private readonly skillMultiplier;
1355
1295
  readonly withSliders: boolean;
1356
- constructor(mods: Mod[], withSliders: boolean);
1296
+ constructor(mods: readonly Mod[], withSliders: boolean);
1357
1297
  protected strainValueAt(current: DroidDifficultyHitObject): number;
1358
1298
  protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
1359
1299
  protected getObjectStrain(): number;
@@ -1379,7 +1319,27 @@ declare abstract class DroidVisualEvaluator {
1379
1319
  * @param mods The mods used.
1380
1320
  * @param withSliders Whether to take slider difficulty into account.
1381
1321
  */
1382
- static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: Mod[], withSliders: boolean): number;
1322
+ static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: readonly Mod[], withSliders: boolean): number;
1323
+ }
1324
+
1325
+ /**
1326
+ * Holds data that can be used to calculate osu!standard performance points.
1327
+ */
1328
+ interface IOsuDifficultyAttributes extends IDifficultyAttributes {
1329
+ /**
1330
+ * The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc).
1331
+ *
1332
+ * Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
1333
+ */
1334
+ approachRate: number;
1335
+ /**
1336
+ * The difficulty corresponding to the speed skill.
1337
+ */
1338
+ speedDifficulty: number;
1339
+ /**
1340
+ * The amount of strains that are considered difficult with respect to the speed skill.
1341
+ */
1342
+ speedDifficultStrainCount: number;
1383
1343
  }
1384
1344
 
1385
1345
  /**
@@ -1423,7 +1383,7 @@ declare class OsuAim extends OsuSkill {
1423
1383
  private readonly skillMultiplier;
1424
1384
  private readonly sliderStrains;
1425
1385
  readonly withSliders: boolean;
1426
- constructor(mods: Mod[], withSliders: boolean);
1386
+ constructor(mods: readonly Mod[], withSliders: boolean);
1427
1387
  /**
1428
1388
  * Obtains the amount of sliders that are considered difficult in terms of relative strain.
1429
1389
  */
@@ -1464,80 +1424,29 @@ declare abstract class OsuAimEvaluator {
1464
1424
  /**
1465
1425
  * Holds data that can be used to calculate osu!standard performance points.
1466
1426
  */
1467
- interface OsuDifficultyAttributes extends DifficultyAttributes {
1468
- /**
1469
- * The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc).
1470
- *
1471
- * Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
1472
- */
1427
+ declare class OsuDifficultyAttributes extends DifficultyAttributes implements IOsuDifficultyAttributes {
1473
1428
  approachRate: number;
1474
- /**
1475
- * The difficulty corresponding to the speed skill.
1476
- */
1477
1429
  speedDifficulty: number;
1478
- /**
1479
- * The amount of strains that are considered difficult with respect to the speed skill.
1480
- */
1481
1430
  speedDifficultStrainCount: number;
1431
+ constructor(cacheableAttributes?: CacheableDifficultyAttributes<IOsuDifficultyAttributes>);
1432
+ toString(): string;
1482
1433
  }
1483
1434
 
1484
1435
  /**
1485
1436
  * A difficulty calculator for osu!standard gamemode.
1486
1437
  */
1487
- declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficultyHitObject, OsuDifficultyAttributes> {
1488
- /**
1489
- * The aim star rating of the beatmap.
1490
- */
1491
- get aim(): number;
1492
- /**
1493
- * The speed star rating of the beatmap.
1494
- */
1495
- get speed(): number;
1496
- /**
1497
- * The flashlight star rating of the beatmap.
1498
- */
1499
- get flashlight(): number;
1500
- readonly attributes: OsuDifficultyAttributes;
1501
- get cacheableAttributes(): CacheableDifficultyAttributes<OsuDifficultyAttributes>;
1438
+ declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuPlayableBeatmap, OsuDifficultyHitObject, OsuDifficultyAttributes> {
1502
1439
  protected readonly difficultyMultiplier = 0.0675;
1503
- protected readonly mode = Modes.osu;
1504
- /**
1505
- * Calculates the aim star rating of the beatmap and stores it in this instance.
1506
- */
1507
- calculateAim(): void;
1508
- /**
1509
- * Calculates the speed star rating of the beatmap and stores it in this instance.
1510
- */
1511
- calculateSpeed(): void;
1512
- /**
1513
- * Calculates the flashlight star rating of the beatmap and stores it in this instance.
1514
- */
1515
- calculateFlashlight(): void;
1516
- calculateTotal(): void;
1517
- calculateAll(): void;
1518
- toString(): string;
1519
- protected generateDifficultyHitObjects(beatmap: Beatmap, clockRate: number): OsuDifficultyHitObject[];
1520
- protected createSkills(): OsuSkill[];
1521
- protected populateDifficultyAttributes(beatmap: Beatmap, clockRate: number): void;
1522
- /**
1523
- * Called after aim skill calculation.
1524
- *
1525
- * @param aimSkill The aim skill that considers sliders.
1526
- * @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
1527
- */
1528
- private postCalculateAim;
1529
- /**
1530
- * Called after speed skill calculation.
1531
- *
1532
- * @param speedSkill The speed skill.
1533
- */
1534
- private postCalculateSpeed;
1535
- /**
1536
- * Called after flashlight skill calculation.
1537
- *
1538
- * @param flashlightSkill The flashlight skill.
1539
- */
1540
- private postCalculateFlashlight;
1440
+ constructor();
1441
+ retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
1442
+ protected createDifficultyAttributes(beatmap: OsuPlayableBeatmap, skills: Skill[]): OsuDifficultyAttributes;
1443
+ protected createPlayableBeatmap(beatmap: Beatmap, mods: Mod[]): OsuPlayableBeatmap;
1444
+ protected createDifficultyHitObjects(beatmap: OsuPlayableBeatmap): OsuDifficultyHitObject[];
1445
+ protected createSkills(beatmap: OsuPlayableBeatmap): OsuSkill[];
1446
+ protected createStrainPeakSkills(beatmap: OsuPlayableBeatmap): StrainSkill[];
1447
+ private populateAimAttributes;
1448
+ private populateSpeedAttributes;
1449
+ private populateFlashlightAttributes;
1541
1450
  }
1542
1451
 
1543
1452
  /**
@@ -1577,13 +1486,13 @@ declare abstract class OsuFlashlightEvaluator {
1577
1486
  * @param current The current object.
1578
1487
  * @param mods The mods used.
1579
1488
  */
1580
- static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: Mod[]): number;
1489
+ static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: readonly Mod[]): number;
1581
1490
  }
1582
1491
 
1583
1492
  /**
1584
1493
  * A performance points calculator that calculates performance points for osu!standard gamemode.
1585
1494
  */
1586
- declare class OsuPerformanceCalculator extends PerformanceCalculator<OsuDifficultyAttributes> {
1495
+ declare class OsuPerformanceCalculator extends PerformanceCalculator<IOsuDifficultyAttributes> {
1587
1496
  /**
1588
1497
  * The aim performance value.
1589
1498
  */
@@ -1676,6 +1585,10 @@ declare class OsuSpeed extends OsuSkill {
1676
1585
  private currentSpeedStrain;
1677
1586
  private currentRhythm;
1678
1587
  private readonly skillMultiplier;
1588
+ /**
1589
+ * The amount of notes that are relevant to the difficulty.
1590
+ */
1591
+ relevantNoteCount(): number;
1679
1592
  /**
1680
1593
  * @param current The hitobject to calculate.
1681
1594
  */
@@ -1709,7 +1622,7 @@ declare abstract class OsuSpeedEvaluator {
1709
1622
  * @param current The current object.
1710
1623
  * @param mods The mods applied.
1711
1624
  */
1712
- static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: Mod[]): number;
1625
+ static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: readonly Mod[]): number;
1713
1626
  }
1714
1627
 
1715
- export { type CacheableDifficultyAttributes, type DifficultSlider, type DifficultyAttributes, type DifficultyCalculationOptions, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, type DroidDifficultyAttributes, type DroidDifficultyCalculationOptions, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, DroidVisual, DroidVisualEvaluator, type ExtendedDroidDifficultyAttributes, type HighStrainSection, OsuAim, OsuAimEvaluator, type OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, type StrainPeaks };
1628
+ export { type CacheableDifficultyAttributes, type DifficultSlider, DifficultyAttributes, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, DroidDifficultyAttributes, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, DroidVisual, DroidVisualEvaluator, ExtendedDroidDifficultyAttributes, type HighStrainSection, type IDifficultyAttributes, type IDroidDifficultyAttributes, type IExtendedDroidDifficultyAttributes, type IOsuDifficultyAttributes, OsuAim, OsuAimEvaluator, OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, type StrainPeaks };