// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; namespace osu.Game.Users { public class UserCoverBackground : Sprite { private readonly User user; public UserCoverBackground(User user) { this.user = user; } [BackgroundDependencyLoader] private async Task load(TextureStore textures) { if (textures == null) throw new ArgumentNullException(nameof(textures)); if (!string.IsNullOrEmpty(user.CoverUrl)) Texture = await textures.GetAsync(user.CoverUrl); } } }