1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 21:42:58 +08:00
osu-lazer/osu.Game/Screens/Ranking/ScorePanelTrackingContainer.cs

36 lines
947 B
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Screens.Ranking
{
public class ScorePanelTrackingContainer : CompositeDrawable
{
public readonly ScorePanel Panel;
public ScorePanelTrackingContainer(ScorePanel panel)
{
Panel = panel;
Attach();
}
public void Detach()
{
if (InternalChildren.Count == 0)
throw new InvalidOperationException("Score panel container is not attached.");
RemoveInternal(Panel);
}
public void Attach()
{
if (InternalChildren.Count > 0)
throw new InvalidOperationException("Score panel container is already attached.");
AddInternal(Panel);
}
}
}