Make Beatmap ISerializable and add more JsonIgnores

This commit is contained in:
smoogipoo
2017-12-06 00:37:37 +09:00
parent 58777a9674
commit b584178e85
14 changed files with 322 additions and 15 deletions

View File

@ -15,6 +15,7 @@ namespace osu.Game.Beatmaps
public class BeatmapInfo : IEquatable<BeatmapInfo>, IJsonSerializable, IHasPrimaryKey
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[JsonIgnore]
public int ID { get; set; }
//TODO: should be in database
@ -38,13 +39,16 @@ namespace osu.Game.Beatmaps
set { onlineBeatmapSetID = value > 0 ? value : null; }
}
[JsonIgnore]
public int BeatmapSetInfoID { get; set; }
[Required]
[JsonIgnore]
public BeatmapSetInfo BeatmapSet { get; set; }
public BeatmapMetadata Metadata { get; set; }
[JsonIgnore]
public int BaseDifficultyID { get; set; }
public BeatmapDifficulty BaseDifficulty { get; set; }
@ -60,6 +64,7 @@ namespace osu.Game.Beatmaps
[JsonProperty("file_sha2")]
public string Hash { get; set; }
[JsonIgnore]
public bool Hidden { get; set; }
/// <summary>
@ -74,6 +79,7 @@ namespace osu.Game.Beatmaps
public float StackLeniency { get; set; }
public bool SpecialStyle { get; set; }
[JsonIgnore]
public int RulesetID { get; set; }
public RulesetInfo Ruleset { get; set; }
@ -116,6 +122,7 @@ namespace osu.Game.Beatmaps
public string Version { get; set; }
public double StarDifficulty { get; set; }
public bool ShouldSerializeStarDifficulty() => false;
public bool Equals(BeatmapInfo other)
{