public static Event newTechnology(Employee e) {
   Project p = e.getWorkingProject();
   if (p != null) {
     Map<Skill, Employee> skill = e.getWorkingProject().getSkill_employeeMap();
     Map<Skill, Integer> require = e.getWorkingProject().getSkillRequirementMap();
     for (Skill sk : skill.keySet()) {
       if (skill.get(sk) != null && skill.get(sk).equals(e)) {
         require.put(sk, require.get(sk) - 50);
         e.getWorkingProject().decreaseRemainingPoint(50);
       }
     }
     return Event.NEW_TECHNOLOGY;
   }
   return Event.NO_EVENT;
 }
 public static Event featureCut(Employee e) {
   Project p = e.getWorkingProject();
   if (p != null) {
     Map<Skill, Employee> skill = e.getWorkingProject().getSkill_employeeMap();
     Map<Skill, Integer> require = e.getWorkingProject().getSkillRequirementMap();
     for (Skill sk : skill.keySet()) {
       if (skill.get(sk) != null && skill.get(sk).equals(e)) {
         int remainPoint = require.get(sk);
         require.put(sk, 0);
         e.getWorkingProject().decreaseRemainingPoint(remainPoint);
       }
     }
     return Event.FEATURE_CUT;
   }
   return Event.NO_EVENT;
 }
コード例 #3
0
 public static Event teamBuilding(Employee e) {
   Project p = e.getWorkingProject();
   if (p != null) {
     Map<Skill, Employee> emList = p.getSkill_employeeMap();
     for (Skill sk : emList.keySet()) {
       if (emList.get(sk) != null) {
         emList.get(sk).getTeamBuilding();
       }
     }
     return Event.TEAM_BUILDING_EXERCISE;
   }
   return Event.NO_EVENT;
 }
 public static Event projectStolen(Employee e, Company c) {
   try {
     Project p = e.getWorkingProject();
     if (p != null) {
       c.cancelProject(p);
       Utilities.getInstance().unassignComputerToEmployee(c, e);
       c.removeEmployee(e);
       return Event.PROJECT_IS_STOLEN_BY_EMPLOYEE;
     } else {
       return Event.NO_EVENT;
     }
   } catch (EmployeeNotExist ex) {
   } finally {
     return Event.NO_EVENT;
   }
 }
 public static Event redundancies(Employee e, Company c) throws EmployeeNotExist {
   Project p = e.getWorkingProject();
   List<Employee> removeEmp = new ArrayList();
   if (p != null) {
     Map<Skill, Employee> skill = p.getSkill_employeeMap();
     for (Skill sk : skill.keySet()) {
       if (skill.get(sk) != null && skill.get(sk).equals(e)) {
         c.addEmployeeToRemoveList(e);
       } else if (skill.get(sk) != null) {
         skill.get(sk).sad();
       }
     }
     for (Employee employee : removeEmp) {
       Utilities.getInstance().unassignComputerToEmployee(c, employee);
       c.removeEmployee(employee);
     }
     return Event.REDUNDANCIES;
   }
   return Event.NO_EVENT;
 }