Ejemplo n.º 1
0
        //Grabs a random full name using the appropriate combo boxes
        private void rollFullNameButton_Click(object sender, EventArgs e)
        {
            String[] name = null;
            if (raceComboBox.Text == "Human" && genderComboBox.Text == "Male")
            {
                name = humanNames.getMaleFullName();
            }
            else if (raceComboBox.Text == "Human" && genderComboBox.Text == "Female")
            {
                name = humanNames.getFemaleFullName();
            }
            else if (raceComboBox.Text == "Elven" && genderComboBox.Text == "Male")
            {
                name = elvenNames.getMaleFullName();
            }
            else if (raceComboBox.Text == "Elven" && genderComboBox.Text == "Female")
            {
                name = elvenNames.getFemaleFullName();
            }
            else if (raceComboBox.Text == "Dwarven" && genderComboBox.Text == "Male")
            {
                name = dwarvenNames.getMaleFullName();
            }
            else if (raceComboBox.Text == "Dwarven" && genderComboBox.Text == "Female")
            {
                name = dwarvenNames.getFemaleFullName();
            }
            else if (raceComboBox.Text == "Halfling" && genderComboBox.Text == "Male")
            {
                name = halflingNames.getMaleFullName();
            }
            else if (raceComboBox.Text == "Halfling" && genderComboBox.Text == "Female")
            {
                name = halflingNames.getFemaleFullName();
            }
            else if (raceComboBox.Text == "Gnomish" && genderComboBox.Text == "Male")
            {
                name = gnomishNames.getMaleFullName();
            }
            else if (raceComboBox.Text == "Gnomish" && genderComboBox.Text == "Female")
            {
                name = gnomishNames.getFemaleFullName();
            }
            else if (raceComboBox.Text == "Gnoll" && genderComboBox.Text == "Male")
            {
                name = gnollNames.getMaleFullName();
            }
            else if (raceComboBox.Text == "Gnoll" && genderComboBox.Text == "Female")
            {
                name = gnollNames.getFemaleFullName();
            }

            if (name != null)
            {
                firstNameLabel.Text = name[0];
                lastNameLabel.Text  = name[1];
            }
        }