コード例 #1
0
ファイル: CSTraining.cs プロジェクト: shrubba/planetexplorers
    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
ファイル: CSTraining.cs プロジェクト: shrubba/planetexplorers
    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
ファイル: CSTraining.cs プロジェクト: shrubba/planetexplorers
    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);
    }