mirror of
https://github.com/ppy/osu
synced 2025-01-08 23:29:43 +00:00
Simplify PerformanceCacheLookup
This commit is contained in:
parent
cd15f83f85
commit
fa201be2ad
@ -9,7 +9,6 @@ using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
namespace osu.Game.Scoring
|
||||
{
|
||||
@ -57,34 +56,21 @@ namespace osu.Game.Scoring
|
||||
|
||||
public readonly struct PerformanceCacheLookup
|
||||
{
|
||||
public readonly double Accuracy;
|
||||
public readonly int BeatmapId;
|
||||
public readonly long TotalScore;
|
||||
public readonly int Combo;
|
||||
public readonly Mod[] Mods;
|
||||
public readonly int RulesetId;
|
||||
public readonly string ScoreHash;
|
||||
public readonly int LocalId;
|
||||
|
||||
public PerformanceCacheLookup(ScoreInfo info)
|
||||
{
|
||||
Accuracy = info.Accuracy;
|
||||
BeatmapId = info.Beatmap.ID;
|
||||
TotalScore = info.TotalScore;
|
||||
Combo = info.Combo;
|
||||
Mods = info.Mods;
|
||||
RulesetId = info.Ruleset.ID ?? 0;
|
||||
ScoreHash = info.Hash;
|
||||
LocalId = info.ID;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hash = new HashCode();
|
||||
|
||||
hash.Add(Accuracy);
|
||||
hash.Add(BeatmapId);
|
||||
hash.Add(TotalScore);
|
||||
hash.Add(Combo);
|
||||
hash.Add(RulesetId);
|
||||
foreach (var mod in Mods)
|
||||
hash.Add(mod);
|
||||
hash.Add(ScoreHash);
|
||||
hash.Add(LocalId);
|
||||
|
||||
return hash.ToHashCode();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user