// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Bindables; namespace osu.Game.Screens.Edit.Components.RadioButtons { public class RadioButton { /// /// Whether this is selected. /// /// public readonly BindableBool Selected; /// /// The text that should be displayed in this button. /// public string Text; /// /// The that should be invoked when this button is selected. /// public Action Action; public RadioButton(string text, Action action) { Text = text; Action = action; Selected = new BindableBool(); } public RadioButton(string text) : this(text, null) { Text = text; Action = null; } /// /// Selects this . /// public void Select() => Selected.Value = true; /// /// Deselects this . /// public void Deselect() => Selected.Value = false; } }