mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Rename RealmContextFactory
to RealmAccess
This commit is contained in:
@ -24,17 +24,17 @@ namespace osu.Game.Database
|
||||
/// </summary>
|
||||
private readonly T data;
|
||||
|
||||
private readonly RealmContextFactory realmFactory;
|
||||
private readonly RealmAccess realm;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new instance of live realm data.
|
||||
/// </summary>
|
||||
/// <param name="data">The realm data.</param>
|
||||
/// <param name="realmFactory">The realm factory the data was sourced from. May be null for an unmanaged object.</param>
|
||||
public RealmLive(T data, RealmContextFactory realmFactory)
|
||||
/// <param name="realm">The realm factory the data was sourced from. May be null for an unmanaged object.</param>
|
||||
public RealmLive(T data, RealmAccess realm)
|
||||
{
|
||||
this.data = data;
|
||||
this.realmFactory = realmFactory;
|
||||
this.realm = realm;
|
||||
|
||||
ID = data.ID;
|
||||
}
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Database
|
||||
return;
|
||||
}
|
||||
|
||||
realmFactory.Run(realm =>
|
||||
realm.Run(realm =>
|
||||
{
|
||||
perform(retrieveFromID(realm, ID));
|
||||
});
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Database
|
||||
if (!IsManaged)
|
||||
return perform(data);
|
||||
|
||||
return realmFactory.Run(realm =>
|
||||
return realm.Run(realm =>
|
||||
{
|
||||
var returnData = perform(retrieveFromID(realm, ID));
|
||||
|
||||
@ -104,7 +104,7 @@ namespace osu.Game.Database
|
||||
if (!ThreadSafety.IsUpdateThread)
|
||||
throw new InvalidOperationException($"Can't use {nameof(Value)} on managed objects from non-update threads");
|
||||
|
||||
return realmFactory.Context.Find<T>(ID);
|
||||
return realm.Realm.Find<T>(ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user