1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Add IsManaged helper method to EF classes to match realm implementation

This commit is contained in:
Dean Herbert 2021-11-19 21:53:40 +09:00
parent d397524878
commit eecf6ad558
12 changed files with 24 additions and 0 deletions

View File

@ -15,6 +15,8 @@ namespace osu.Game.Beatmaps
public int ID { get; set; }
public bool IsManaged => ID > 0;
public float DrainRate { get; set; } = DEFAULT_DIFFICULTY;
public float CircleSize { get; set; } = DEFAULT_DIFFICULTY;
public float OverallDifficulty { get; set; } = DEFAULT_DIFFICULTY;

View File

@ -21,6 +21,8 @@ namespace osu.Game.Beatmaps
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public int BeatmapVersion;
private int? onlineID;

View File

@ -20,6 +20,8 @@ namespace osu.Game.Beatmaps
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public string Title { get; set; } = string.Empty;
[JsonProperty("title_unicode")]

View File

@ -11,6 +11,8 @@ namespace osu.Game.Beatmaps
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public int BeatmapSetInfoID { get; set; }
public int FileInfoID { get; set; }

View File

@ -16,6 +16,8 @@ namespace osu.Game.Beatmaps
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
private int? onlineID;
[Column("OnlineBeatmapSetID")]

View File

@ -11,6 +11,8 @@ namespace osu.Game.Configuration
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public int? RulesetID { get; set; }
public int? Variant { get; set; }

View File

@ -11,5 +11,7 @@ namespace osu.Game.Database
[JsonIgnore]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
int ID { get; set; }
bool IsManaged { get; }
}
}

View File

@ -10,6 +10,8 @@ namespace osu.Game.IO
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public string Hash { get; set; }
public string StoragePath => Path.Combine(Hash.Remove(1), Hash.Remove(2), Hash);

View File

@ -11,6 +11,8 @@ namespace osu.Game.Scoring
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public int FileInfoID { get; set; }
public FileInfo FileInfo { get; set; }

View File

@ -22,6 +22,8 @@ namespace osu.Game.Scoring
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public ScoreRank Rank { get; set; }
public long TotalScore { get; set; }

View File

@ -11,6 +11,8 @@ namespace osu.Game.Skinning
{
public int ID { get; set; }
public bool IsManaged => ID > 0;
public int SkinInfoID { get; set; }
public int FileInfoID { get; set; }

View File

@ -18,6 +18,8 @@ namespace osu.Game.Skinning
public int ID { get; set; }
public bool IsManaged => ID > 0;
public string Name { get; set; } = string.Empty;
public string Creator { get; set; } = string.Empty;