1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 05:52:55 +08:00

Make DrawableRank safer.

This commit is contained in:
Dean Herbert 2017-03-22 08:32:28 +09:00
parent 8983bbcaad
commit 1699daaf7f
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -14,30 +14,18 @@ namespace osu.Game.Screens.Select.Leaderboards
public class DrawableRank : Container
{
private Sprite sprite;
private TextureStore textures;
private ScoreRank rank;
public ScoreRank Rank
{
get { return rank; }
set
{
if (value == rank) return;
rank = value;
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{rank.GetDescription()}");
}
}
public ScoreRank Rank { get; private set; }
[BackgroundDependencyLoader]
private void load(TextureStore ts)
private void load(TextureStore textures)
{
textures = ts;
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{rank.GetDescription()}");
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{Rank.GetDescription()}");
}
public DrawableRank(ScoreRank rank)
{
this.rank = rank;
Rank = rank;
Children = new Drawable[]
{