Skip to content

Use IScoreInfo in ExtendedScore instead of SoloScoreInfo#299

Open
TextAdventurer12 wants to merge 2 commits intoppy:masterfrom
TextAdventurer12:extendedscore-refactor
Open

Use IScoreInfo in ExtendedScore instead of SoloScoreInfo#299
TextAdventurer12 wants to merge 2 commits intoppy:masterfrom
TextAdventurer12:extendedscore-refactor

Conversation

@TextAdventurer12
Copy link
Copy Markdown

This means that ExtendedScore works for both SoloScoreInfo from the API and ScoreInfo from other sources (like realm).
Renamed most places that used ExtendedScore Score to ExtendedScore ExtScore because SoloScore doesn't work well as a name anymore and I think Score.Score sounds stupid.
Statistics and Mods need manual conversions because osu-side infrastructure is a bit of a mess around them.

Copy link
Copy Markdown
Member

@stanriders stanriders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check CI as well

public class ExtendedScore
{
public SoloScoreInfo SoloScore { get; }
public IScoreInfo Score { get; }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just ScoreInfo? The only reason this is using SoloScoreInfo now is because the data is always sourced from the API so it was convenient, but we convert it to ScoreInfo anyway to run pp calculation

private const float performance_background_shear = 0.45f;

public readonly ExtendedScore Score;
public readonly ExtendedScore ExtScore;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public readonly ExtendedScore ExtScore;
public readonly ExtendedScore ExtendedScore;

private partial class ScorePerformanceContainer : OsuHoverContainer
{
private readonly ExtendedScore score;
private readonly ExtendedScore extScore;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private readonly ExtendedScore extScore;
private readonly ExtendedScore extendedScore;

public partial class ScoreContainer : Container
{
public ExtendedScore Score { get; }
public ExtendedScore ExtScore { get; }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public ExtendedScore ExtScore { get; }
public ExtendedScore ExtendedScore { get; }


// IScoreInfo is missing statistics right now, but both SoloScoreInfo and ScoreInfo have it (and I believe it's planned for future)
// I think handling conversion at this level is the most elegant, although it means supporting any additional types that inherit from IScoreInfo will need to be manually added here
public Dictionary<HitResult, int>? Statistics
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just awful

@stanriders stanriders added the perfcalc-gui PerformanceCalculatorGUI label Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perfcalc-gui PerformanceCalculatorGUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants