private void OnCreateButton(object sender, EventArgs e) { if (statsBox.SelectedIndex == -1) { MessageBox.Show("Choose a stat from the list."); } else if (statValueBox.Text.ElementAt(0) == '(') { MessageBox.Show("Enter a positive or negative amount for the effect."); } else { Stats.Effect effect = new Stats.Effect(); effect.name = (string)statsBox.SelectedItem; int value; int.TryParse(statValueBox.Text, out value); effect.value = value; string effectPrefix; if (effect.value < 0) { effectPrefix = "Damage"; } else { effectPrefix = "Fortify"; } effect.name = effectPrefix + " " + effect.name; knownEffects.Add(effect); //effectsBox.Items.Add(newEffectName); } }
void Add(Stats.Effect effect) { }