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