// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; using osu.Game.Users; namespace osu.Game.Overlays.BeatmapSet.Scores { public abstract class ClickableUserContainer : Container { private UserProfileOverlay profile; protected ClickableUserContainer() { AutoSizeAxes = Axes.Both; } [BackgroundDependencyLoader(true)] private void load(UserProfileOverlay profile) { this.profile = profile; } private User user; public User User { get => user; set { if (user == value) return; user = value; OnUserChanged(user); } } protected abstract void OnUserChanged(User user); protected override bool OnClick(ClickEvent e) { profile?.ShowUser(user); return true; } } }