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;
|
|
|
|
|
2021-11-22 17:34:04 +08:00
|
|
|
#nullable enable
|
|
|
|
|
2021-01-07 13:35:15 +08:00
|
|
|
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-04-26 16:06:03 +08:00
|
|
|
public Guid ID { get; set; } = Guid.NewGuid();
|
2021-01-07 13:35:15 +08:00
|
|
|
|
2021-11-22 17:34:04 +08:00
|
|
|
public string? RulesetName { get; set; }
|
2021-01-07 13:35:15 +08:00
|
|
|
|
|
|
|
public int? Variant { get; set; }
|
|
|
|
|
2022-01-19 08:46:45 +08:00
|
|
|
[Ignored]
|
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
|
|
|
}
|
|
|
|
|
2022-01-19 08:46:45 +08:00
|
|
|
[Ignored]
|
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))]
|
2021-11-22 17:34:04 +08:00
|
|
|
public string KeyCombinationString { get; set; } = string.Empty;
|
2021-01-07 13:35:15 +08:00
|
|
|
}
|
|
|
|
}
|