2017-07-13 12:17:47 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-11-08 06:13:56 +08:00
|
|
|
|
using System;
|
2017-07-13 12:17:47 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
|
|
2017-07-13 12:24:59 +08:00
|
|
|
|
namespace osu.Game.Beatmaps.Drawables
|
2017-07-13 12:17:47 +08:00
|
|
|
|
{
|
|
|
|
|
public class BeatmapSetCover : Sprite
|
|
|
|
|
{
|
|
|
|
|
private readonly BeatmapSetInfo set;
|
|
|
|
|
public BeatmapSetCover(BeatmapSetInfo set)
|
|
|
|
|
{
|
2017-11-08 06:13:56 +08:00
|
|
|
|
if (set == null)
|
|
|
|
|
throw new ArgumentNullException(nameof(set));
|
|
|
|
|
|
2017-07-13 12:17:47 +08:00
|
|
|
|
this.set = set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(TextureStore textures)
|
|
|
|
|
{
|
|
|
|
|
string resource = set.OnlineInfo.Covers.Cover;
|
|
|
|
|
|
|
|
|
|
if (resource != null)
|
|
|
|
|
Texture = textures.Get(resource);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|