2021-01-07 13:35:15 +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.
|
|
|
|
|
2021-01-19 17:22:23 +08:00
|
|
|
using System;
|
2021-01-07 13:35:15 +08:00
|
|
|
using osu.Framework.Input.Bindings;
|
|
|
|
using osu.Game.Database;
|
|
|
|
using Realms;
|
|
|
|
|
|
|
|
namespace osu.Game.Input.Bindings
|
|
|
|
{
|
2021-01-13 17:07:35 +08:00
|
|
|
[MapTo(nameof(KeyBinding))]
|
2021-01-08 14:49:01 +08:00
|
|
|
public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey, IKeyBinding
|
2021-01-07 13:35:15 +08:00
|
|
|
{
|
2021-01-08 14:49:01 +08:00
|
|
|
[PrimaryKey]
|
2021-03-26 19:07:53 +08:00
|
|
|
public string StringGuid { get; set; }
|
|
|
|
|
|
|
|
[Ignored]
|
|
|
|
public Guid ID
|
|
|
|
{
|
|
|
|
get => Guid.Parse(StringGuid);
|
|
|
|
set => StringGuid = value.ToString();
|
|
|
|
}
|
2021-01-07 13:35:15 +08:00
|
|
|
|
|
|
|
public int? RulesetID { get; set; }
|
|
|
|
|
|
|
|
public int? Variant { get; set; }
|
|
|
|
|
2021-01-13 17:07:35 +08:00
|
|
|
public KeyCombination KeyCombination
|
2021-01-08 14:49:01 +08:00
|
|
|
{
|
2021-01-13 17:07:35 +08:00
|
|
|
get => KeyCombinationString;
|
|
|
|
set => KeyCombinationString = value.ToString();
|
2021-01-08 14:49:01 +08:00
|
|
|
}
|
|
|
|
|
2021-01-13 17:07:35 +08:00
|
|
|
public object Action
|
2021-01-08 14:49:01 +08:00
|
|
|
{
|
2021-01-13 17:07:35 +08:00
|
|
|
get => ActionInt;
|
|
|
|
set => ActionInt = (int)value;
|
2021-01-08 14:49:01 +08:00
|
|
|
}
|
|
|
|
|
2021-01-13 17:07:35 +08:00
|
|
|
[MapTo(nameof(Action))]
|
|
|
|
public int ActionInt { get; set; }
|
2021-01-07 15:53:36 +08:00
|
|
|
|
2021-01-13 17:07:35 +08:00
|
|
|
[MapTo(nameof(KeyCombination))]
|
|
|
|
public string KeyCombinationString { get; set; }
|
2021-01-07 13:35:15 +08:00
|
|
|
}
|
|
|
|
}
|