2021-10-11 14:25:00 +08:00
// 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.
2022-06-30 14:40:44 +08:00
using System ;
2021-10-11 14:25:00 +08:00
using JetBrains.Annotations ;
2021-10-13 11:51:41 +08:00
using osu.Framework.Testing ;
2021-10-11 14:25:00 +08:00
using osu.Game.Database ;
using osu.Game.IO ;
using Realms ;
namespace osu.Game.Models
{
2021-10-13 11:51:41 +08:00
[ExcludeFromDynamicCompile]
2021-10-11 14:25:00 +08:00
public class RealmNamedFileUsage : EmbeddedObject , INamedFile , INamedFileUsage
{
public RealmFile File { get ; set ; } = null ! ;
2021-11-26 15:36:05 +08:00
// [Indexed] cannot be used on `EmbeddedObject`s as it only applies to top-level queries. May need to reconsider this if performance becomes a concern.
2021-10-11 14:25:00 +08:00
public string Filename { get ; set ; } = null ! ;
public RealmNamedFileUsage ( RealmFile file , string filename )
{
2022-06-30 14:40:44 +08:00
File = file ? ? throw new ArgumentNullException ( nameof ( file ) ) ;
Filename = filename ? ? throw new ArgumentNullException ( nameof ( filename ) ) ;
2021-10-11 14:25:00 +08:00
}
[UsedImplicitly]
private RealmNamedFileUsage ( )
{
}
IFileInfo INamedFileUsage . File = > File ;
}
}