1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +08:00

Change IBeatmapMetadataInfo.Author to be an IUser

This commit is contained in:
Dean Herbert 2021-11-04 18:13:45 +09:00
parent b9983add15
commit 7547810979
3 changed files with 21 additions and 2 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Game.Users;
#nullable enable
@ -35,7 +36,7 @@ namespace osu.Game.Beatmaps
/// <summary>
/// The author of this beatmap.
/// </summary>
string Author { get; } // eventually should be linked to a persisted User.
IUser Author { get; }
/// <summary>
/// The source of this beatmap.

View File

@ -5,6 +5,7 @@ using System;
using Newtonsoft.Json;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Users;
using Realms;
#nullable enable
@ -26,7 +27,7 @@ namespace osu.Game.Models
[JsonProperty("artist_unicode")]
public string ArtistUnicode { get; set; } = string.Empty;
public string Author { get; set; } = string.Empty; // eventually should be linked to a persisted User.
public RealmUser Author { get; set; } = new RealmUser();
public string Source { get; set; } = string.Empty;
@ -41,5 +42,7 @@ namespace osu.Game.Models
public string AudioFile { get; set; } = string.Empty;
public string BackgroundFile { get; set; } = string.Empty;
IUser IBeatmapMetadataInfo.Author => Author;
}
}

View File

@ -0,0 +1,15 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Users;
using Realms;
namespace osu.Game.Models
{
public class RealmUser : EmbeddedObject, IUser
{
public int OnlineID { get; set; } = 1;
public string Username { get; set; }
}
}