mirror of
https://github.com/osukey/osukey.git
synced 2025-05-19 12:37:38 +09:00
Apply suggestion concerning the BeatmapSetType enum
This commit is contained in:
parent
ebaef86432
commit
b8b5c67cd2
@ -8,23 +8,35 @@ namespace osu.Game.Online.API.Requests
|
|||||||
public class GetUserBeatmapsRequest : APIRequest<List<GetBeatmapSetsResponse>>
|
public class GetUserBeatmapsRequest : APIRequest<List<GetBeatmapSetsResponse>>
|
||||||
{
|
{
|
||||||
private readonly long userId;
|
private readonly long userId;
|
||||||
private readonly BeatmapSetType type;
|
|
||||||
private readonly int offset;
|
private readonly int offset;
|
||||||
|
private readonly string type;
|
||||||
|
|
||||||
public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0)
|
public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.type = type;
|
|
||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case BeatmapSetType.Favourite:
|
||||||
|
this.type = type.ToString().ToLower();
|
||||||
|
break;
|
||||||
|
case BeatmapSetType.MostPlayed:
|
||||||
|
this.type = "most_played";
|
||||||
|
break;
|
||||||
|
case BeatmapSetType.RankedAndApproved:
|
||||||
|
this.type = "ranked_and_approved";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().ToLower()}?offset={offset}";
|
protected override string Target => $@"users/{userId}/beatmapsets/{type}?offset={offset}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BeatmapSetType
|
public enum BeatmapSetType
|
||||||
{
|
{
|
||||||
Most_Played,
|
MostPlayed,
|
||||||
Favourite,
|
Favourite,
|
||||||
Ranked_And_Approved
|
RankedAndApproved
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
int passCount = beatmap.OnlineInfo.PassCount;
|
int passCount = beatmap.OnlineInfo.PassCount;
|
||||||
int playCount = beatmap.OnlineInfo.PlayCount;
|
int playCount = beatmap.OnlineInfo.PlayCount;
|
||||||
|
|
||||||
var rate = (playCount != 0) ? (float)passCount / playCount : 0;
|
var rate = playCount != 0 ? (float)passCount / playCount : 0;
|
||||||
successPercent.Text = rate.ToString("P0");
|
successPercent.Text = rate.ToString("P0");
|
||||||
successRate.Length = rate;
|
successRate.Length = rate;
|
||||||
percentContainer.ResizeWidthTo(successRate.Length, 250, Easing.InOutCubic);
|
percentContainer.ResizeWidthTo(successRate.Length, 250, Easing.InOutCubic);
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."),
|
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."),
|
||||||
new PaginatedBeatmapContainer(BeatmapSetType.Ranked_And_Approved, User, "Ranked & Approved Beatmaps", "None... yet."),
|
new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps", "None... yet."),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user