// 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 System.Linq; using Newtonsoft.Json; using osu.Game.Rulesets.Difficulty.Skills; using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Difficulty { /// /// Describes the difficulty of a beatmap, as output by a . /// [JsonObject(MemberSerialization.OptIn)] public class DifficultyAttributes { /// /// The mods which were applied to the beatmap. /// public Mod[] Mods { get; set; } /// /// The skills resulting from the difficulty calculation. /// public Skill[] Skills { get; set; } /// /// The combined star rating of all skill. /// [JsonProperty("star_rating", Order = -3)] public double StarRating { get; set; } /// /// The maximum achievable combo. /// [JsonProperty("max_combo", Order = -2)] public int MaxCombo { get; set; } /// /// Creates new . /// public DifficultyAttributes() { } /// /// Creates new . /// /// The mods which were applied to the beatmap. /// The skills resulting from the difficulty calculation. /// The combined star rating of all skills. public DifficultyAttributes(Mod[] mods, Skill[] skills, double starRating) { Mods = mods; Skills = skills; StarRating = starRating; } /// /// Converts this to osu-web compatible database attribute mappings. /// /// /// See: osu_difficulty_attribs table. /// public virtual IEnumerable<(int attributeId, object value)> ToDatabaseAttributes() => Enumerable.Empty<(int, object)>(); /// /// Reads osu-web database attribute mappings into this object. /// /// The attribute mappings. public virtual void FromDatabaseAttributes(IReadOnlyDictionary values) { } } }