Пример #1
0
    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);
    }
Пример #2
0
    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);
    }
Пример #3
0
    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);
    }