-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Breaking changes
Occasionally we will make changes which require custom rulesets to make amendments to maintain compatibility. Wherever possible, we maintain compatibility via [Obsolete]
attributes, but it is encouraged that you leave obsolete warnings turned on, and deal with them sooner rather than later. Generally we aim to leave obsolete methods around for 3-6 months after obsoletion.
This page serves to give a list of all breaking/major changes.
Mod.Description
type has been changed
// ...
- public override string Description => "...";
+ public override LocalisableString Description => "...";
// ...
ResumeOverlay.Message
type has been changed
// ...
- protected override string Message => "...";
+ protected override LocalisableString Message => "...";
// ...
Ruleset.GetDisplayNameForHitResult(HitResult)
type has been changed
// ...
- public override string GetDisplayNameForHitResult(HitResult result)
+ public override LocalisableString GetDisplayNameForHitResult(HitResult result)
// ...
Ruleset.GetVariantName(int variant)
type has been changed
// ...
- public override string GetVariantName(int variant)
+ public override LocalisableString GetVariantName(int variant)
// ...
The PerformanceCalculator
signature has changed a bit in order for performance calculators to be constructed less during critical code paths. Refer to the following diff for required changes:
// Constructor signature.
- ctor(Ruleset ruleset, DifficultyAttributes attributes, ScoreInfo score);
+ ctor();
// These are the methods that actually perform the calculation:
- public virtual PerformanceAttributes Calculate();
+ protected virtual PerformanceAttributes CreatePerformanceAttributes(ScoreInfo score, DifficultyAttributes attributes);
// Helper methods to calculate performance:
+ public PerformanceAttributes Calculate(ScoreInfo score, DifficultyAttributes attributes);
+ public PerformanceAttributes Calculate(ScoreInfo score, IWorkingBeatmap beatmap);
// Ruleset API:
- public PerformanceCalculator CreatePerformanceCalculator(IWorkingBeatmap beatmap, ScoreInfo score);
- public virtual PerformanceCalculator CreatePerformanceCalculator(DifficultyAttributes attributes, ScoreInfo score);
+ public virtual PerformanceCalculator CreatePerformanceCalculator();
Migration is simple: define a constructor on custom ScoreProcessor
implementations and pass an instance of your Ruleset
to the base constructor.
Accessibility has also changed from public
to protected
, however the rest of the method signature remains identical and a simple find-replace can be used to fix existing usages.