コード例 #1
0
 private string FindRaceStatValues(int raceSelection)
 {
     BaseCharacterRace tempRace;
     if(raceSelection == 0) {
         tempRace = new BaseHumanRace();
         string tempStats = "Strength: " + tempRace.Strength + "\n" + "Intellect: " + tempRace.Intellect + "\n" + "Dexterity: " + tempRace.Dexterity;
         return tempStats;
     }else if(raceSelection == 1) {
         tempRace = new BaseOrcRace();
         string tempStats = "Strength: " + tempRace.Strength + "\n" + "Intellect: " + tempRace.Intellect + "\n" + "Dexterity: " + tempRace.Dexterity;
         return tempStats;
     }else if(raceSelection == 2) {
         tempRace = new BaseElfRace();
         string tempStats = "Strength: " + tempRace.Strength + "\n" + "Intellect: " + tempRace.Intellect + "\n" + "Dexterity: " + tempRace.Dexterity;
         return tempStats;
     }else if(raceSelection == 3) {
         tempRace = new BaseUndeadRace();
         string tempStats = "Strength: " + tempRace.Strength + "\n" + "Intellect: " + tempRace.Intellect + "\n" + "Dexterity: " + tempRace.Dexterity;
         return tempStats;
     }
     return "";
 }
コード例 #2
0
 //Finds the description of the Selected race
 private string FindRaceDescrption(int raceSelection)
 {
     BaseCharacterRace tempRace;
     if(raceSelection == 0) {
         tempRace = new BaseHumanRace();
         return tempRace.CharacterRaceDescription;
     } else if(raceSelection == 1) {
         tempRace = new BaseOrcRace();
         return tempRace.CharacterRaceDescription;
     } else if(raceSelection == 2) {
         tempRace = new BaseElfRace();
         return tempRace.CharacterRaceDescription;
     } else if(raceSelection == 3) {
         tempRace = new BaseUndeadRace();
         return tempRace.CharacterRaceDescription;
     }
     return "No Race selected";
 }