1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 02:27:25 +08:00
osu-lazer/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs

37 lines
1.0 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Extensions;
using osu.Game.Modes.Scoring;
namespace osu.Game.Screens.Select.Leaderboards
{
public class DrawableRank : Container
{
2017-03-27 21:22:34 +08:00
private readonly Sprite rankSprite;
2017-03-22 07:32:28 +08:00
public ScoreRank Rank { get; private set; }
[BackgroundDependencyLoader]
2017-03-22 07:32:28 +08:00
private void load(TextureStore textures)
{
2017-03-27 21:22:34 +08:00
rankSprite.Texture = textures.Get($@"Grades/{Rank.GetDescription()}");
}
public DrawableRank(ScoreRank rank)
{
2017-03-22 07:32:28 +08:00
Rank = rank;
Children = new Drawable[]
{
2017-03-27 21:22:34 +08:00
rankSprite = new Sprite { FillMode = FillMode.Fill },
};
}
}
}