2019-01-24 17:43:03 +09: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.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-07-21 13:15:07 +02:00
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Localisation;
|
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
namespace osu.Game.Beatmaps
|
|
|
|
|
{
|
2021-07-21 13:15:07 +02:00
|
|
|
|
[LocalisableEnum(typeof(BeatmapSetOnlineStatusEnumLocalisationMapper))]
|
2018-04-13 18:19:50 +09:00
|
|
|
|
public enum BeatmapSetOnlineStatus
|
|
|
|
|
{
|
|
|
|
|
None = -3,
|
|
|
|
|
Graveyard = -2,
|
|
|
|
|
WIP = -1,
|
|
|
|
|
Pending = 0,
|
|
|
|
|
Ranked = 1,
|
|
|
|
|
Approved = 2,
|
|
|
|
|
Qualified = 3,
|
|
|
|
|
Loved = 4,
|
|
|
|
|
}
|
2021-04-30 12:40:16 -07:00
|
|
|
|
|
|
|
|
|
public static class BeatmapSetOnlineStatusExtensions
|
|
|
|
|
{
|
|
|
|
|
public static bool GrantsPerformancePoints(this BeatmapSetOnlineStatus status)
|
|
|
|
|
=> status == BeatmapSetOnlineStatus.Ranked || status == BeatmapSetOnlineStatus.Approved;
|
|
|
|
|
}
|
2021-07-21 13:15:07 +02:00
|
|
|
|
|
|
|
|
|
public class BeatmapSetOnlineStatusEnumLocalisationMapper : EnumLocalisationMapper<BeatmapSetOnlineStatus>
|
|
|
|
|
{
|
|
|
|
|
public override LocalisableString Map(BeatmapSetOnlineStatus value)
|
|
|
|
|
{
|
|
|
|
|
switch (value)
|
|
|
|
|
{
|
|
|
|
|
case BeatmapSetOnlineStatus.None:
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
|
|
|
|
case BeatmapSetOnlineStatus.Graveyard:
|
|
|
|
|
return BeatmapsetsStrings.ShowStatusGraveyard;
|
|
|
|
|
|
|
|
|
|
case BeatmapSetOnlineStatus.WIP:
|
|
|
|
|
return BeatmapsetsStrings.ShowStatusWip;
|
|
|
|
|
|
|
|
|
|
case BeatmapSetOnlineStatus.Pending:
|
|
|
|
|
return BeatmapsetsStrings.ShowStatusPending;
|
|
|
|
|
|
|
|
|
|
case BeatmapSetOnlineStatus.Ranked:
|
|
|
|
|
return BeatmapsetsStrings.ShowStatusRanked;
|
|
|
|
|
|
|
|
|
|
case BeatmapSetOnlineStatus.Approved:
|
|
|
|
|
return BeatmapsetsStrings.ShowStatusApproved;
|
|
|
|
|
|
|
|
|
|
case BeatmapSetOnlineStatus.Qualified:
|
|
|
|
|
return BeatmapsetsStrings.ShowStatusQualified;
|
|
|
|
|
|
|
|
|
|
case BeatmapSetOnlineStatus.Loved:
|
|
|
|
|
return BeatmapsetsStrings.ShowStatusLoved;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|