Example #1
0
        //Grabs a random last name using the appropriate combo boxes
        private void rollLastNameButton_Click(object sender, EventArgs e)
        {
            String name = null;

            if (raceComboBox.Text == "Human")
            {
                name = humanNames.getLastName();
            }
            else if (raceComboBox.Text == "Elven")
            {
                name = elvenNames.getLastName();
            }
            else if (raceComboBox.Text == "Dwarven")
            {
                name = dwarvenNames.getLastName();
            }
            else if (raceComboBox.Text == "Halfling")
            {
                name = halflingNames.getLastName();
            }
            else if (raceComboBox.Text == "Gnomish")
            {
                name = gnomishNames.getLastName();
            }
            else if (raceComboBox.Text == "Gnoll")
            {
                name = gnollNames.getLastName();
            }

            if (name != null)
            {
                lastNameLabel.Text = name;
            }
        }