2021-01-07 05:35:15 +00: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 09:22:23 +00:00
|
|
|
using System;
|
2021-01-07 05:35:15 +00:00
|
|
|
using osu.Framework.Input.Bindings;
|
|
|
|
using osu.Game.Database;
|
|
|
|
using Realms;
|
|
|
|
|
2021-11-22 09:34:04 +00:00
|
|
|
#nullable enable
|
|
|
|
|
2021-01-07 05:35:15 +00:00
|
|
|
namespace osu.Game.Input.Bindings
|
|
|
|
{
|
2021-01-13 09:07:35 +00:00
|
|
|
[MapTo(nameof(KeyBinding))]
|
2021-01-08 06:49:01 +00:00
|
|
|
public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey, IKeyBinding
|
2021-01-07 05:35:15 +00:00
|
|
|
{
|
2021-01-08 06:49:01 +00:00
|
|
|
[PrimaryKey]
|
2021-04-26 08:06:03 +00:00
|
|
|
public Guid ID { get; set; } = Guid.NewGuid();
|
2021-01-07 05:35:15 +00:00
|
|
|
|
2021-11-22 09:34:04 +00:00
|
|
|
public string? RulesetName { get; set; }
|
2021-01-07 05:35:15 +00:00
|
|
|
|
|
|
|
public int? Variant { get; set; }
|
|
|
|
|
2022-01-19 00:46:45 +00:00
|
|
|
[Ignored]
|
2021-01-13 09:07:35 +00:00
|
|
|
public KeyCombination KeyCombination
|
2021-01-08 06:49:01 +00:00
|
|
|
{
|
2021-01-13 09:07:35 +00:00
|
|
|
get => KeyCombinationString;
|
|
|
|
set => KeyCombinationString = value.ToString();
|
2021-01-08 06:49:01 +00:00
|
|
|
}
|
|
|
|
|
2022-01-19 00:46:45 +00:00
|
|
|
[Ignored]
|
2021-01-13 09:07:35 +00:00
|
|
|
public object Action
|
2021-01-08 06:49:01 +00:00
|
|
|
{
|
2021-01-13 09:07:35 +00:00
|
|
|
get => ActionInt;
|
|
|
|
set => ActionInt = (int)value;
|
2021-01-08 06:49:01 +00:00
|
|
|
}
|
|
|
|
|
2021-01-13 09:07:35 +00:00
|
|
|
[MapTo(nameof(Action))]
|
|
|
|
public int ActionInt { get; set; }
|
2021-01-07 07:53:36 +00:00
|
|
|
|
2021-01-13 09:07:35 +00:00
|
|
|
[MapTo(nameof(KeyCombination))]
|
2021-11-22 09:34:04 +00:00
|
|
|
public string KeyCombinationString { get; set; } = string.Empty;
|
2021-01-07 05:35:15 +00:00
|
|
|
}
|
|
|
|
}
|