General cleanups

This commit is contained in:
smoogipoo
2020-06-19 21:41:48 +09:00
parent 81ad257a17
commit 25abdc2903
9 changed files with 98 additions and 48 deletions

View File

@ -6,16 +6,27 @@ using osu.Framework.Graphics.Containers;
namespace osu.Game.Screens.Ranking
{
/// <summary>
/// A <see cref="CompositeDrawable"/> which tracks the size of a <see cref="ScorePanel"/>, to which the <see cref="ScorePanel"/> can be added or removed.
/// </summary>
public class ScorePanelTrackingContainer : CompositeDrawable
{
/// <summary>
/// The <see cref="ScorePanel"/> that created this <see cref="ScorePanelTrackingContainer"/>.
/// </summary>
public readonly ScorePanel Panel;
public ScorePanelTrackingContainer(ScorePanel panel)
internal ScorePanelTrackingContainer(ScorePanel panel)
{
Panel = panel;
Attach();
}
/// <summary>
/// Detaches the <see cref="ScorePanel"/> from this <see cref="ScorePanelTrackingContainer"/>, removing it as a child.
/// This <see cref="ScorePanelTrackingContainer"/> will continue tracking any size changes.
/// </summary>
/// <exception cref="InvalidOperationException">If the <see cref="ScorePanel"/> is already detached.</exception>
public void Detach()
{
if (InternalChildren.Count == 0)
@ -24,6 +35,10 @@ namespace osu.Game.Screens.Ranking
RemoveInternal(Panel);
}
/// <summary>
/// Attaches the <see cref="ScorePanel"/> to this <see cref="ScorePanelTrackingContainer"/>, adding it as a child.
/// </summary>
/// <exception cref="InvalidOperationException">If the <see cref="ScorePanel"/> is already attached.</exception>
public void Attach()
{
if (InternalChildren.Count > 0)