1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-22 18:07:19 +08:00

Move JsonIgnore specification to interface

This commit is contained in:
Dean Herbert 2018-11-30 16:39:25 +09:00
parent 58293c3eae
commit e82ad3539b
5 changed files with 2 additions and 8 deletions

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using Newtonsoft.Json;
using osu.Game.Database;
namespace osu.Game.Beatmaps
@ -13,7 +12,6 @@ namespace osu.Game.Beatmaps
/// </summary>
public const float DEFAULT_DIFFICULTY = 5;
[JsonIgnore]
public int ID { get; set; }
public float DrainRate { get; set; } = DEFAULT_DIFFICULTY;

View File

@ -15,7 +15,6 @@ namespace osu.Game.Beatmaps
[Serializable]
public class BeatmapInfo : IEquatable<BeatmapInfo>, IJsonSerializable, IHasPrimaryKey
{
[JsonIgnore]
public int ID { get; set; }
public int BeatmapVersion;
@ -29,7 +28,6 @@ namespace osu.Game.Beatmaps
set => onlineBeatmapID = value > 0 ? value : null;
}
[JsonIgnore]
public int BeatmapSetInfoID { get; set; }
public BeatmapSetOnlineStatus Status { get; set; } = BeatmapSetOnlineStatus.None;

View File

@ -2,11 +2,13 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace osu.Game.Database
{
public interface IHasPrimaryKey
{
[JsonIgnore]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
int ID { get; set; }
}

View File

@ -2,15 +2,12 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace osu.Game.Rulesets
{
public class RulesetInfo : IEquatable<RulesetInfo>
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[JsonIgnore]
public int? ID { get; set; }
public string Name { get; set; }

View File

@ -17,7 +17,6 @@ namespace osu.Game.Scoring
{
public class ScoreInfo : IHasFiles<ScoreFileInfo>, IHasPrimaryKey, ISoftDelete
{
[JsonIgnore]
public int ID { get; set; }
public ScoreRank Rank { get; set; }