mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Rename RealmContextFactory
to RealmAccess
This commit is contained in:
@ -25,7 +25,7 @@ namespace osu.Game.Input.Bindings
|
||||
private IDisposable realmSubscription;
|
||||
|
||||
[Resolved]
|
||||
private RealmContextFactory realmFactory { get; set; }
|
||||
private RealmAccess realm { get; set; }
|
||||
|
||||
public override IEnumerable<IKeyBinding> DefaultKeyBindings => ruleset.CreateInstance().GetDefaultKeyBindings(variant ?? 0);
|
||||
|
||||
@ -49,13 +49,13 @@ namespace osu.Game.Input.Bindings
|
||||
private IQueryable<RealmKeyBinding> queryRealmKeyBindings()
|
||||
{
|
||||
string rulesetName = ruleset?.ShortName;
|
||||
return realmFactory.Context.All<RealmKeyBinding>()
|
||||
.Where(b => b.RulesetName == rulesetName && b.Variant == variant);
|
||||
return realm.Realm.All<RealmKeyBinding>()
|
||||
.Where(b => b.RulesetName == rulesetName && b.Variant == variant);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
realmSubscription = realmFactory.RegisterForNotifications(realm => queryRealmKeyBindings(), (sender, changes, error) =>
|
||||
realmSubscription = realm.RegisterForNotifications(realm => queryRealmKeyBindings(), (sender, changes, error) =>
|
||||
{
|
||||
// The first fire of this is a bit redundant as this is being called in base.LoadComplete,
|
||||
// but this is safest in case the subscription is restored after a context recycle.
|
||||
|
@ -16,12 +16,12 @@ namespace osu.Game.Input
|
||||
{
|
||||
public class RealmKeyBindingStore
|
||||
{
|
||||
private readonly RealmContextFactory realmFactory;
|
||||
private readonly RealmAccess realm;
|
||||
private readonly ReadableKeyCombinationProvider keyCombinationProvider;
|
||||
|
||||
public RealmKeyBindingStore(RealmContextFactory realmFactory, ReadableKeyCombinationProvider keyCombinationProvider)
|
||||
public RealmKeyBindingStore(RealmAccess realm, ReadableKeyCombinationProvider keyCombinationProvider)
|
||||
{
|
||||
this.realmFactory = realmFactory;
|
||||
this.realm = realm;
|
||||
this.keyCombinationProvider = keyCombinationProvider;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ namespace osu.Game.Input
|
||||
{
|
||||
List<string> combinations = new List<string>();
|
||||
|
||||
realmFactory.Run(context =>
|
||||
realm.Run(context =>
|
||||
{
|
||||
foreach (var action in context.All<RealmKeyBinding>().Where(b => string.IsNullOrEmpty(b.RulesetName) && (GlobalAction)b.ActionInt == globalAction))
|
||||
{
|
||||
@ -56,7 +56,7 @@ namespace osu.Game.Input
|
||||
/// <param name="rulesets">The rulesets to populate defaults from.</param>
|
||||
public void Register(KeyBindingContainer container, IEnumerable<RulesetInfo> rulesets)
|
||||
{
|
||||
realmFactory.Run(realm =>
|
||||
realm.Run(realm =>
|
||||
{
|
||||
using (var transaction = realm.BeginWrite())
|
||||
{
|
||||
|
Reference in New Issue
Block a user