mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 03:52:54 +08:00
Remove ScoreInfo allocations in multi leaderboard
This commit is contained in:
parent
0020102810
commit
6e94a9780b
@ -228,6 +228,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
public int? Team => (User.MatchState as TeamVersusUserState)?.TeamID;
|
public int? Team => (User.MatchState as TeamVersusUserState)?.TeamID;
|
||||||
|
|
||||||
private readonly RulesetInfo ruleset;
|
private readonly RulesetInfo ruleset;
|
||||||
|
private readonly ScoreInfo scoreInfo;
|
||||||
|
|
||||||
public TrackedUserData(MultiplayerRoomUser user, RulesetInfo ruleset, ScoreProcessor scoreProcessor)
|
public TrackedUserData(MultiplayerRoomUser user, RulesetInfo ruleset, ScoreProcessor scoreProcessor)
|
||||||
{
|
{
|
||||||
@ -236,6 +237,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
User = user;
|
User = user;
|
||||||
ScoreProcessor = scoreProcessor;
|
ScoreProcessor = scoreProcessor;
|
||||||
|
|
||||||
|
scoreInfo = new ScoreInfo { Ruleset = ruleset };
|
||||||
|
|
||||||
ScoringMode.BindValueChanged(_ => UpdateScore());
|
ScoringMode.BindValueChanged(_ => UpdateScore());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,12 +256,10 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
var header = frame.Header;
|
var header = frame.Header;
|
||||||
|
|
||||||
Score.Value = ScoreProcessor.ComputePartialScore(ScoringMode.Value, new ScoreInfo
|
scoreInfo.MaxCombo = header.MaxCombo;
|
||||||
{
|
scoreInfo.Statistics = header.Statistics;
|
||||||
Ruleset = ruleset,
|
|
||||||
MaxCombo = header.MaxCombo,
|
Score.Value = ScoreProcessor.ComputePartialScore(ScoringMode.Value, scoreInfo);
|
||||||
Statistics = header.Statistics
|
|
||||||
});
|
|
||||||
|
|
||||||
Accuracy.Value = header.Accuracy;
|
Accuracy.Value = header.Accuracy;
|
||||||
CurrentCombo.Value = header.Combo;
|
CurrentCombo.Value = header.Combo;
|
||||||
|
Loading…
Reference in New Issue
Block a user