2 using System.Collections.Generic;
5 using System.Threading.Tasks;
6 using Microsoft.Xna.Framework;
12 private Dictionary<int, GUITickBox> radioButtons;
16 radioButtons =
new Dictionary<int, GUITickBox>();
26 foreach(KeyValuePair<int, GUITickBox> rbPair
in radioButtons)
28 rbPair.Value.Enabled = value;
35 if (selected == key) radioButton.
Selected =
true;
36 else if (radioButton.
Selected) selected = key;
39 radioButtons.Add((
int)key, radioButton);
47 foreach (KeyValuePair<int, GUITickBox> rbPair
in radioButtons)
49 if (radioButton == rbPair.Value)
58 private new int? selected;
68 if (selected !=
null && selected.Equals(value)) {
return; }
70 foreach (KeyValuePair<int, GUITickBox> radioButton
in radioButtons)
72 if (radioButton.Key.Equals(value))
74 radioButton.Value.Selected =
true;
76 else if (radioButton.Value.Selected)
78 radioButton.Value.Selected =
false;
88 return selected.HasValue ? radioButtons[selected.Value] :
null;
void SetRadioButtonGroup(GUIRadioButtonGroup rbg)