diff --git a/osu.Game/Input/ActionMappingInputManager.cs b/osu.Game/Input/ActionMappingInputManager.cs index d926b888c5..836f0734fd 100644 --- a/osu.Game/Input/ActionMappingInputManager.cs +++ b/osu.Game/Input/ActionMappingInputManager.cs @@ -15,6 +15,10 @@ using SQLiteNetExtensions.Attributes; namespace osu.Game.Input { + /// + /// Maps custom action data of type and stores to . + /// + /// The type of the custom action. public class ActionMappingInputManager : PassThroughInputManager where T : struct { @@ -22,6 +26,11 @@ namespace osu.Game.Input private readonly int? variant; + /// + /// Create a new instance. + /// + /// A reference to identify the current . Used to lookup mappings. Null for global mappings. + /// An optional variant for the specified . Used when a ruleset has more than one possible keyboard layouts. protected ActionMappingInputManager(RulesetInfo ruleset = null, int? variant = null) { this.ruleset = ruleset; @@ -67,36 +76,4 @@ namespace osu.Game.Input return default(T); } } - - public class Binding - { - [ForeignKey(typeof(RulesetInfo))] - public int? RulesetID { get; set; } - - [Indexed] - public int? Variant { get; set; } - - public Key Key { get; set; } - - public int Action { get; set; } - } - - public class BindingStore : DatabaseBackedStore - { - public BindingStore(SQLiteConnection connection, Storage storage = null) - : base(connection, storage) - { - } - - protected override void Prepare(bool reset = false) - { - Connection.CreateTable(); - } - - protected override Type[] ValidTypes => new[] - { - typeof(Binding) - }; - - } } diff --git a/osu.Game/Input/Binding.cs b/osu.Game/Input/Binding.cs new file mode 100644 index 0000000000..6f7a1594b2 --- /dev/null +++ b/osu.Game/Input/Binding.cs @@ -0,0 +1,20 @@ +using osu.Game.Rulesets; +using OpenTK.Input; +using SQLite.Net.Attributes; +using SQLiteNetExtensions.Attributes; + +namespace osu.Game.Input +{ + public class Binding + { + [ForeignKey(typeof(RulesetInfo))] + public int? RulesetID { get; set; } + + [Indexed] + public int? Variant { get; set; } + + public Key Key { get; set; } + + public int Action { get; set; } + } +} \ No newline at end of file diff --git a/osu.Game/Input/BindingStore.cs b/osu.Game/Input/BindingStore.cs new file mode 100644 index 0000000000..e20ea2e68b --- /dev/null +++ b/osu.Game/Input/BindingStore.cs @@ -0,0 +1,26 @@ +using System; +using osu.Framework.Platform; +using osu.Game.Database; +using SQLite.Net; + +namespace osu.Game.Input +{ + public class BindingStore : DatabaseBackedStore + { + public BindingStore(SQLiteConnection connection, Storage storage = null) + : base(connection, storage) + { + } + + protected override void Prepare(bool reset = false) + { + Connection.CreateTable(); + } + + protected override Type[] ValidTypes => new[] + { + typeof(Binding) + }; + + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 482422cfd9..aba4384b59 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -92,6 +92,8 @@ + +