2021-01-12 16:09:55 +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;
|
|
|
|
|
2021-01-12 16:09:55 +08:00
|
|
|
namespace osu.Game.Overlays.BeatmapListing
|
|
|
|
{
|
2021-06-16 14:58:07 +08:00
|
|
|
[LocalisableEnum(typeof(SearchExplicitEnumLocalisationMapper))]
|
2021-01-12 16:09:55 +08:00
|
|
|
public enum SearchExplicit
|
|
|
|
{
|
|
|
|
Hide,
|
|
|
|
Show
|
|
|
|
}
|
2021-06-16 14:58:07 +08:00
|
|
|
|
|
|
|
public class SearchExplicitEnumLocalisationMapper : EnumLocalisationMapper<SearchExplicit>
|
|
|
|
{
|
|
|
|
public override LocalisableString Map(SearchExplicit value)
|
|
|
|
{
|
|
|
|
switch (value)
|
|
|
|
{
|
|
|
|
case SearchExplicit.Hide:
|
|
|
|
return BeatmapsStrings.NsfwExclude;
|
|
|
|
|
|
|
|
case SearchExplicit.Show:
|
|
|
|
return BeatmapsStrings.NsfwInclude;
|
|
|
|
|
|
|
|
default:
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-12 16:09:55 +08:00
|
|
|
}
|