Why doesn't this code work?
It doesn't set the affinity correctly. It writes "1" though. I can't figure it out. Also, is this the correct code to do this?
Code:
foreach (RadioButton ctrl1 in panel1.Controls)
{
RadioButton rb1;
List<RadioButton> rbs = new List<RadioButton>();
if ((RadioButton)ctrl1.Checked = true)
{
rbs.Add(ctrl1);
rb1 = rbs.IndexOf(0);
string text;
text = rb1.Text;
Affin type1 = (Affin)Enum.Parse(typeof(Affin), text, true);
type1 = attacker.Affinity;
Continue = true;
textBox1.Text = "1";
}
}