1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 11:12:54 +08:00

Serialise type as snake_case

This commit is contained in:
Dean Herbert 2021-08-03 23:08:11 +09:00
parent 6442d86407
commit e11b815b82
2 changed files with 11 additions and 0 deletions

View File

@ -7,6 +7,8 @@ namespace osu.Game.Online.Rooms
{
public enum MatchType
{
// used for osu-web deserialization so names shouldn't be changed.
Playlists,
[Description("Head to head")]

View File

@ -64,6 +64,15 @@ namespace osu.Game.Online.Rooms
[JsonIgnore]
public readonly Bindable<MatchType> Type = new Bindable<MatchType>();
// Todo: osu-framework bug (https://github.com/ppy/osu-framework/issues/4106)
[JsonConverter(typeof(SnakeCaseStringEnumConverter))]
[JsonProperty("type")]
private MatchType type
{
get => Type.Value;
set => Type.Value = value;
}
[Cached]
[JsonIgnore]
public readonly Bindable<int?> MaxParticipants = new Bindable<int?>();