2019-01-24 16:43:03 +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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using osu.Framework.Input.Bindings;
|
|
|
|
using osu.Game.Database;
|
|
|
|
|
|
|
|
namespace osu.Game.Input.Bindings
|
|
|
|
{
|
|
|
|
[Table("KeyBinding")]
|
2021-01-08 14:49:01 +08:00
|
|
|
public class DatabasedKeyBinding : IKeyBinding, IHasPrimaryKey
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
|
|
|
public int ID { get; set; }
|
|
|
|
|
|
|
|
public int? RulesetID { get; set; }
|
|
|
|
|
|
|
|
public int? Variant { get; set; }
|
|
|
|
|
|
|
|
[Column("Keys")]
|
2021-01-08 14:49:01 +08:00
|
|
|
public string KeysString { get; set; }
|
|
|
|
|
|
|
|
[Column("Action")]
|
|
|
|
public int IntAction { get; set; }
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
public KeyCombination KeyCombination
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2021-01-08 14:49:01 +08:00
|
|
|
get => KeysString;
|
|
|
|
set => KeysString = value.ToString();
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
|
2021-01-08 14:49:01 +08:00
|
|
|
[NotMapped]
|
|
|
|
public object Action
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2021-01-08 14:49:01 +08:00
|
|
|
get => IntAction;
|
|
|
|
set => IntAction = (int)value;
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|