public string TakeTest(World world, Agency agency) { string message = ""; //agent takes test Random rnd = new Random(); double agentTestingScore = ((1 + (rnd.Next(-5, 11) / 100)) * Intelligence * 0.5) + ((1 + (rnd.Next(-5, 11) / 100)) * LicenseTestPrep * 0.8); //if agent obtains license if (agentTestingScore >= 75) { LicensesHeld.Add(AppliedLicense); //message into newsLabel message = First + " " + Last + " has earned a license for " + AppliedLicense.Sport.ToString().ToLower() + "!"; //world.CreateNewClients(agency, AppliedLicense); //reset license information AppliedLicense = null; LicenseTestPrep = 0; HasAppliedForLicense = false; } //agent failed test else { message = First + " " + Last + " failed the test for " + AppliedLicense.Sport.ToString().ToLower() + "! Try again next week!"; } TestedThisWeek = true; return(message); }
public Agent(string firstName, string lastName, int salary, int negotiatingRating, int greedRating, int industryPowerRating, int intelligence, int levelRating, Roles role) { First = firstName; Last = lastName; FullName = firstName + " " + lastName; Salary = salary; CareerEarnings = 0; Negotiating = negotiatingRating; Greed = greedRating; IndustryPower = industryPowerRating; Intelligence = intelligence; Level = levelRating; Role = role; ClientList = new List <Player>(); LicensesHeld = new List <Licenses>(); BeingTrainedForTest = false; AppliedLicense = null; HasAppliedForLicense = false; TestedThisWeek = false; }