1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-29 23:17:29 +08:00
osu-lazer/osu.Game/Overlays/BeatmapListing/SearchPlayed.cs

39 lines
1.1 KiB
C#
Raw Normal View History

2020-10-28 02:30:53 +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;
using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
2020-10-28 02:30:53 +08:00
namespace osu.Game.Overlays.BeatmapListing
{
[LocalisableEnum(typeof(SearchPlayedEnumLocalisationMapper))]
public enum SearchPlayed
{
Any,
Played,
Unplayed
}
2021-06-16 14:58:07 +08:00
public class SearchPlayedEnumLocalisationMapper : EnumLocalisationMapper<SearchPlayed>
2020-10-28 02:30:53 +08:00
{
public override LocalisableString Map(SearchPlayed value)
2021-06-16 14:58:07 +08:00
{
switch (value)
{
case SearchPlayed.Any:
return BeatmapsStrings.PlayedAny;
2021-06-16 14:58:07 +08:00
case SearchPlayed.Played:
return BeatmapsStrings.PlayedPlayed;
2021-06-16 14:58:07 +08:00
case SearchPlayed.Unplayed:
return BeatmapsStrings.PlayedUnplayed;
2021-06-16 14:58:07 +08:00
default:
throw new ArgumentOutOfRangeException(nameof(value), value, null);
}
2021-06-16 14:58:07 +08:00
}
2020-10-28 02:30:53 +08:00
}
}