Пример #1
0
        private void addOK_Click(object sender, EventArgs e)
        {
            if (this.combatantName.Text != String.Empty)
            {
                Combatant newCombatant;
                if (combatantHP.Enabled && combatantHP.IntValue != 0) newCombatant = new Combatant(combatantName.Text, combatantHP.IntValue);
                else newCombatant = new Combatant(combatantName.Text);

                parentForm.combatantList.Items.Add(newCombatant);
                this.Close();
            }
        }
Пример #2
0
 private void adjustHPColour(Combatant selectedCombatant)
 {
     // Update the HP bar's colour depending on the combatant's current HP
     if (combatantHPBar.Value > (selectedCombatant.getMaxHP() / 2)) combatantHPBar.ForeColor = Color.Indigo;
 }