static void Main(string[] args) { // fields //Character characterTest = new Character(); // variable to test the character class. //Hero heroTest = new Hero(); // variable to test the hero class. Hero hero1 = new SoftwareEngineer("Stuart", true);// variable to test the S.E. class as a Hero. //Hero hero2 = new InformationSecurity("Peter", true);// variable to test the I.S. //Hero hero3 = new NetworkArchitect("Tara", false);// variable to test the N.A. //Hero hero4 = new SupportEngineer("Melissa", false);// variable to test the S.E. //Hero hero5 = new SystemsAnalyst("Jack", true);// variable to test the S.A. //Enemy villian = new CampusPolice();// variable to test the C.P. //Enemy villian2 = new FoodServer();// variable to test the F.S. //Enemy villian3 = new Gardener();// variable to test the Gardener. //Enemy raven = new Boss("Dr. Ravenscroft", true);// variable to test the Boss. //Enemy enemyTest = new Enemy(); // variable to test the enemy class. // arrays to hold heroes and enemies. //Hero[] heroes = new Hero[] {hero1, hero2, hero3, hero4, hero5}; //Enemy[] enemies = new Enemy[] {villian, villian2, villian3}; // test content of the Character and hero class. //Console.WriteLine("\n" + heroTest.toString()); // test content of the Enemy class. //Console.WriteLine(enemyTest.ToString()); // test content of the software engineer as a hero. Console.WriteLine(hero1.ToString()); // print test for heroes // foreach(Hero index in heroes) // Console.WriteLine(index.ToString()); // print test for enemies // foreach (Enemy index in enemies) // Console.WriteLine(index.ToString()); // print test for the boss. //Console.WriteLine(raven.ToString()); // hold the terminal open to view the stats. Console.ReadLine(); }
static void Main(string[] args) { // fields Character characterTest = new Character(); // variable to test the character class. Hero heroTest = new Hero(); // variable to test the hero class. Hero hero1 = new SoftwareEngineer("Stuart", true); // variable to test the S.E. class as a Hero. Enemy enemyTest = new Enemy(); // variable to test the enemy class. // test content of the Character and hero class. //Console.WriteLine("\n" + heroTest.toString()); // test content of the Enemy class. //Console.WriteLine(enemyTest.ToString()); // test content of the software engineer as a hero. Console.WriteLine(hero1.ToString()); // hold the terminal open to view the stats. Console.ReadLine(); }
public void placeCharacter() { for (int i = 0; i < 5; i++) { switch (job_type[i]) { case "Software Engineer": { heroes[i] = new SoftwareEngineer(hero_name[i], gender[i]); break; } case "Support Engineer": { heroes[i] = new SupportEngineer(hero_name[i], gender[i]); break; } case "Systems Analyst": { heroes[i] = new SystemsAnalyst(hero_name[i], gender[i]); break; } case "Network Architect": { heroes[i] = new NetworkArchitect(hero_name[i], gender[i]); break; } case "Information Security": { heroes[i] = new InformationSecurity(hero_name[i], gender[i]); break; } default: { break; } } } heroOneSlot.Source = heroes[0].CharacterPortrait; heroTwoSlot.Source = heroes[1].CharacterPortrait; heroThreeSlot.Source = heroes[2].CharacterPortrait; heroFourSlot.Source = heroes[3].CharacterPortrait; heroFiveSlot.Source = heroes[4].CharacterPortrait; nameLabelOne.Content = heroes[0].Name; nameLabelTwo.Content = heroes[1].Name; nameLabelThree.Content = heroes[2].Name; nameLabelFour.Content = heroes[3].Name; nameLabelFive.Content = heroes[4].Name; if(heroes[0].Male) genderLabelOne.Content = "Male"; else genderLabelOne.Content = "Female"; if (heroes[1].Male) genderLabelTwo.Content = "Male"; else genderLabelTwo.Content = "Female"; if (heroes[2].Male) genderLabelThree.Content = "Male"; else genderLabelThree.Content = "Female"; if (heroes[3].Male) genderLabelFour.Content = "Male"; else genderLabelFour.Content = "Female"; if (heroes[4].Male) genderLabelFive.Content = "Male"; else genderLabelFive.Content = "Female"; jobLabelOne.Content = heroes[0].JobRole; jobLabelTwo.Content = heroes[1].JobRole; jobLabelThree.Content = heroes[2].JobRole; jobLabelFour.Content = heroes[3].JobRole; jobLabelFive.Content = heroes[4].JobRole; }
private void AcceptButton_Click(object sender, RoutedEventArgs e) { tempName = NameBox.Text; if(!((tempName == "") || (tempName == "Enter Name."))) { switch (tempJobRole) { case "Software Engineer": { heroes[heroSlot] = new SoftwareEngineer(tempName, tempGender); break; } case "Support Engineer": { heroes[heroSlot] = new SupportEngineer(tempName, tempGender); break; } case "Systems Analyst": { heroes[heroSlot] = new SystemsAnalyst(tempName, tempGender); break; } case "Network Architect": { heroes[heroSlot] = new NetworkArchitect(tempName, tempGender); break; } case "Information Security": { heroes[heroSlot] = new InformationSecurity(tempName, tempGender); break; } default: { break; } } if (Checker()) { confirmButtonSwitch(); } CustomizeWindowGrid.Visibility = Visibility.Hidden; BlackOut.Visibility = Visibility.Hidden; switch (heroSlot) { case 0: { heroOneSlot.Source = heroes[heroSlot].CharacterPortrait; nameLabelOne.Content = heroes[heroSlot].Name; jobLabelOne.Content = heroes[heroSlot].JobRole; if (heroes[heroSlot].Male) genderLabelOne.Content = "Male"; else genderLabelOne.Content = "Female"; break; } case 1: { heroTwoSlot.Source = heroes[heroSlot].CharacterPortrait; nameLabelTwo.Content = heroes[heroSlot].Name; jobLabelTwo.Content = heroes[heroSlot].JobRole; if (heroes[heroSlot].Male) genderLabelTwo.Content = "Male"; else genderLabelTwo.Content = "Female"; break; } case 2: { heroThreeSlot.Source = heroes[heroSlot].CharacterPortrait; nameLabelThree.Content = heroes[heroSlot].Name; jobLabelThree.Content = heroes[heroSlot].JobRole; if (heroes[heroSlot].Male) genderLabelThree.Content = "Male"; else genderLabelThree.Content = "Female"; break; } case 3: { heroFourSlot.Source = heroes[heroSlot].CharacterPortrait; nameLabelFour.Content = heroes[heroSlot].Name; jobLabelFour.Content = heroes[heroSlot].JobRole; if (heroes[heroSlot].Male) genderLabelFour.Content = "Male"; else genderLabelFour.Content = "Female"; break; } case 4: { heroFiveSlot.Source = heroes[heroSlot].CharacterPortrait; nameLabelFive.Content = heroes[heroSlot].Name; jobLabelFive.Content = heroes[heroSlot].JobRole; if (heroes[heroSlot].Male) genderLabelFive.Content = "Male"; else genderLabelFive.Content = "Female"; break; } default: { break; } } } else { NameBox.Text = "Enter Name."; } }