2019-05-25 06:00:53 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-24 08:43:03 +00:00
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using osu.Game.Database;
|
|
|
|
|
|
|
|
namespace osu.Game.Configuration
|
|
|
|
{
|
|
|
|
[Table("Settings")]
|
2021-09-15 08:25:07 +00:00
|
|
|
public class DatabasedSetting : IHasPrimaryKey // can be removed 20220315.
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
public int ID { get; set; }
|
|
|
|
|
|
|
|
public int? RulesetID { get; set; }
|
|
|
|
|
|
|
|
public int? Variant { get; set; }
|
|
|
|
|
2019-05-25 06:09:31 +00:00
|
|
|
public int? SkinInfoID { get; set; }
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
[Column("Key")]
|
2019-05-25 06:00:53 +00:00
|
|
|
public string Key { get; set; }
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
[Column("Value")]
|
|
|
|
public string StringValue
|
|
|
|
{
|
|
|
|
get => Value.ToString();
|
|
|
|
set => Value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public object Value;
|
|
|
|
|
2019-05-25 06:00:53 +00:00
|
|
|
public DatabasedSetting(string key, object value)
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
Key = key;
|
|
|
|
Value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Constructor for derived classes that may require serialisation.
|
|
|
|
/// </summary>
|
|
|
|
public DatabasedSetting()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string ToString() => $"{Key}=>{Value}";
|
|
|
|
}
|
|
|
|
}
|