public bool AddInstructor(CSPersonnel p) { if (InstructorList.Contains(p.ID)) { return(true); } if (InstructorList.Count >= MAX_INSTRUCTOR_NUM) { return(false); } if (TraineeNpcId == p.ID) { if (m_Counter != null) { StopCounter(); } TraineeNpcId = -1; } TraineeList.Remove(p.ID); InstructorList.Add(p.ID); p.trainerType = ETrainerType.Instructor; UpdateUI(); return(true); }
public bool CheckInstructorId(int instructorId) { CSPersonnel instructor = m_MgCreator.GetNpc(instructorId); if (instructor == null || instructor.m_Occupation != CSConst.potTrainer) { return(false); } if (!InstructorList.Contains(instructorId)) { return(false); } return(true); }
public bool CheckInstructorAndTraineeId(int instructorId, int traineeId) { CSPersonnel instructorNpc = m_MgCreator.GetNpc(instructorId); CSPersonnel traineeNpc = m_MgCreator.GetNpc(traineeId); if (instructorNpc == null || traineeNpc == null) { return(false); } if (instructorNpc.m_Occupation != CSConst.potTrainer || traineeNpc.m_Occupation != CSConst.potTrainer) { return(false); } if (!InstructorList.Contains(instructorId) || !TraineeList.Contains(traineeId)) { return(false); } return(true); }