// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using Newtonsoft.Json; using osu.Game.Beatmaps; using osu.Game.Rulesets.Difficulty; namespace osu.Game.Rulesets.Mania.Difficulty { public struct ManiaDifficultyAttributes : IDifficultyAttributes { public ManiaDifficultyAttributes() { } /// public double StarRating { get; set; } /// public int MaxCombo { get; set; } /// /// The hit window for a GREAT hit inclusive of rate-adjusting mods (DT/HT/etc). /// /// /// Rate-adjusting mods do not affect the hit window at all in osu-stable. /// [JsonProperty("great_hit_window")] public double GreatHitWindow { get; set; } public IEnumerable<(int attributeId, object value)> ToDatabaseAttributes() { yield return (IDifficultyAttributes.ATTRIB_ID_MAX_COMBO, MaxCombo); yield return (IDifficultyAttributes.ATTRIB_ID_DIFFICULTY, StarRating); yield return (IDifficultyAttributes.ATTRIB_ID_GREAT_HIT_WINDOW, GreatHitWindow); } public void FromDatabaseAttributes(IReadOnlyDictionary values, IBeatmapOnlineInfo onlineInfo) { MaxCombo = (int)values[IDifficultyAttributes.ATTRIB_ID_MAX_COMBO]; StarRating = values[IDifficultyAttributes.ATTRIB_ID_DIFFICULTY]; GreatHitWindow = values[IDifficultyAttributes.ATTRIB_ID_GREAT_HIT_WINDOW]; } } }