private void HandleThoughtSatisfied(object sender, ThoughtEventArgs e) { if (e.Type == ThoughtType.Hungry) { EventHelper.FireEvent(EmployeeHungerSatisfied, sender, e); } else if (e.Type == ThoughtType.Thirsty) { EventHelper.FireEvent(EmployeeThirstSatisfied, sender, e); } }
private void HandleHadThought(object sender, ThoughtEventArgs e) { Thought thought = GenerateThought(e.Type); Employee employee = sender as Employee; if (employee != null) { employee.AddUnsatisfiedThought(thought); TakeActionBasedOnThought(employee, thought.Type); if (HadThought != null) { HadThought(sender, e); } } }
private void HandleEmployeeHadThought(object sender, ThoughtEventArgs e) { var employee = GetEmployeeFromEventSender(sender); //if (e.Type == ThoughtType.Hungry) // SendEmployeeMessageToUserInterface(employee, String.Format("{0} is hungry!", employee.FullName), SimulationMessageType.EmployeeIsHungry); //else if (e.Type == ThoughtType.Thirsty) // SendEmployeeMessageToUserInterface(employee, String.Format("{0} is thirsty!", employee.FullName), SimulationMessageType.EmployeeIsThirsty); //else if (e.Type == ThoughtType.Dirty) // SendEmployeeMessageToUserInterface(employee, String.Format("{0} is dirty!", employee.FullName), SimulationMessageType.EmployeeIsDirty); //else if (e.Type == ThoughtType.NeedsDeskAssignment) // SendEmployeeMessageToUserInterface(employee, String.Format("{0} needs and office desk to work!", employee.FullName), SimulationMessageType.EmployeeNeedsDesk); //else if (e.Type == ThoughtType.Sleepy) // SendEmployeeMessageToUserInterface(employee, String.Format("{0} is sleepy!", employee.FullName), SimulationMessageType.EmployeeIsSleepy); //else if (e.Type == ThoughtType.Unhappy) // SendEmployeeMessageToUserInterface(employee, String.Format("{0} is unhappy!", employee.FullName), SimulationMessageType.EmployeeIsUnhappy); //else if (e.Type == ThoughtType.Unhealthy) // SendEmployeeMessageToUserInterface(employee, String.Format("{0} is unhealthy!", employee.FullName), SimulationMessageType.EmployeeIsUnhealthy); }