// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Framework.Configuration; 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; } }