public bool AddTrainee(CSPersonnel p) { if (TraineeList.Contains(p.ID)) { return(true); } if (TraineeList.Count >= MAX_TRAINEE_NUM) { return(false); } if (InstructorNpcId == p.ID) { if (m_Counter != null) { StopCounter(); } InstructorNpcId = -1; } InstructorList.Remove(p.ID); TraineeList.Add(p.ID); p.trainerType = ETrainerType.Trainee; UpdateUI(); return(true); }
public bool CheckTraineeId(int traineeId) { CSPersonnel trainee = m_MgCreator.GetNpc(traineeId); if (trainee == null || trainee.m_Occupation != CSConst.potTrainer) { return(false); } if (!TraineeList.Contains(traineeId)) { 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); }