1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 05:22:54 +08:00
osu-lazer/osu.Game/Overlays/BeatmapListing/SearchGenre.cs

88 lines
2.4 KiB
C#
Raw Normal View History

2020-04-21 14:37:50 +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-06-16 14:58:07 +08:00
using System;
2020-04-21 14:37:50 +08:00
using System.ComponentModel;
2021-06-16 14:58:07 +08:00
using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
2020-04-21 14:37:50 +08:00
namespace osu.Game.Overlays.BeatmapListing
{
2021-06-16 14:58:07 +08:00
[LocalisableEnum(typeof(SearchGenreEnumLocalisationMapper))]
2020-04-21 14:37:50 +08:00
public enum SearchGenre
{
Any = 0,
Unspecified = 1,
[Description("Video Game")]
VideoGame = 2,
Anime = 3,
Rock = 4,
Pop = 5,
Other = 6,
Novelty = 7,
[Description("Hip Hop")]
HipHop = 9,
2020-06-13 14:48:30 +08:00
Electronic = 10,
Metal = 11,
Classical = 12,
Folk = 13,
Jazz = 14
2020-04-21 14:37:50 +08:00
}
2021-06-16 14:58:07 +08:00
public class SearchGenreEnumLocalisationMapper : EnumLocalisationMapper<SearchGenre>
{
public override LocalisableString Map(SearchGenre value)
{
switch (value)
{
case SearchGenre.Any:
return BeatmapsStrings.GenreAny;
case SearchGenre.Unspecified:
return BeatmapsStrings.GenreUnspecified;
case SearchGenre.VideoGame:
return BeatmapsStrings.GenreVideoGame;
case SearchGenre.Anime:
return BeatmapsStrings.GenreAnime;
case SearchGenre.Rock:
return BeatmapsStrings.GenreRock;
case SearchGenre.Pop:
return BeatmapsStrings.GenrePop;
case SearchGenre.Other:
return BeatmapsStrings.GenreOther;
case SearchGenre.Novelty:
return BeatmapsStrings.GenreNovelty;
case SearchGenre.HipHop:
return BeatmapsStrings.GenreHipHop;
case SearchGenre.Electronic:
return BeatmapsStrings.GenreElectronic;
case SearchGenre.Metal:
return BeatmapsStrings.GenreMetal;
case SearchGenre.Classical:
return BeatmapsStrings.GenreClassical;
case SearchGenre.Folk:
return BeatmapsStrings.GenreFolk;
case SearchGenre.Jazz:
return BeatmapsStrings.GenreJazz;
default:
throw new ArgumentOutOfRangeException(nameof(value), value, null);
}
}
}
2020-04-21 14:37:50 +08:00
}