osu/osu.Game/Online/Leaderboards/UpdateableRank.cs

38 lines
925 B
C#
Raw Normal View History

2019-06-19 00:50:16 +00: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.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Scoring;
namespace osu.Game.Online.Leaderboards
{
public class UpdateableRank : ModelBackedDrawable<ScoreRank?>
2019-06-19 00:50:16 +00:00
{
public ScoreRank? Rank
2019-06-19 00:50:16 +00:00
{
get => Model;
set => Model = value;
}
public UpdateableRank(ScoreRank? rank)
2019-06-19 00:50:16 +00:00
{
Rank = rank;
}
protected override Drawable CreateDrawable(ScoreRank? rank)
2019-06-19 00:50:16 +00:00
{
if (rank.HasValue)
{
return new DrawableRank(rank.Value)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
};
}
return null;
}
2019-06-19 00:50:16 +00:00
}
}