2019-06-19 08:50:16 +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.
|
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2019-06-19 08:50:16 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.Leaderboards
|
|
|
|
|
{
|
2020-03-28 23:22:01 +08:00
|
|
|
|
public partial class UpdateableRank : ModelBackedDrawable<ScoreRank?>
|
2019-06-19 08:50:16 +08:00
|
|
|
|
{
|
2020-03-28 23:22:01 +08:00
|
|
|
|
public ScoreRank? Rank
|
2019-06-19 08:50:16 +08:00
|
|
|
|
{
|
|
|
|
|
get => Model;
|
|
|
|
|
set => Model = value;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-23 13:09:00 +08:00
|
|
|
|
public UpdateableRank(ScoreRank? rank = null)
|
2019-06-19 08:50:16 +08:00
|
|
|
|
{
|
|
|
|
|
Rank = rank;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-28 23:22:01 +08:00
|
|
|
|
protected override Drawable CreateDrawable(ScoreRank? rank)
|
2019-06-19 08:50:16 +08:00
|
|
|
|
{
|
2020-03-28 23:22:01 +08:00
|
|
|
|
if (rank.HasValue)
|
|
|
|
|
{
|
|
|
|
|
return new DrawableRank(rank.Value)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2019-06-19 08:50:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|