Rename RealmContextFactory to RealmAccess

This commit is contained in:
Dean Herbert
2022-01-24 19:59:58 +09:00
parent bb54ad9ad8
commit 6eb2c28e41
76 changed files with 516 additions and 516 deletions

View File

@ -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);
}
}