/*Creates a new instance of the Pet class for the user.
        *Takes input from the text boxes on the form to intialize the pet stats
        */
        private void btnCreate_Click(object sender, EventArgs e)
        {
            //Store input
            string petName = txtNameInput.Text;
            int petHealth = int.Parse(txtHealthInput.Text);
            int petAttack = int.Parse(txtAttackInput.Text);
            int petDefense = int.Parse(txtDefenseInput.Text);

            //Create instance of a pet using user input
            Pet userPet = new Pet(petName, petHealth, petAttack, petDefense);

            //Show the Manager form to the user with their pet information
            frmManager petMan = new frmManager(userPet);
            Hide();
            petMan.Show();
        }
Exemple #2
0
        /*Creates a new instance of the Pet class for the user.
         * Takes input from the text boxes on the form to intialize the pet stats
         */
        private void btnCreate_Click(object sender, EventArgs e)
        {
            //Store input
            string petName    = txtNameInput.Text;
            int    petHealth  = int.Parse(txtHealthInput.Text);
            int    petAttack  = int.Parse(txtAttackInput.Text);
            int    petDefense = int.Parse(txtDefenseInput.Text);

            //Create instance of a pet using user input
            Pet userPet = new Pet(petName, petHealth, petAttack, petDefense);

            //Show the Manager form to the user with their pet information
            frmManager petMan = new frmManager(userPet);

            Hide();
            petMan.Show();
        }