Пример #1
0
    private void InitAllGaidenTask()
    {
        var allGaidenInfos = ConfigManager.GetAll <GaidenTaskInfo>();
        var allTasks       = ConfigManager.GetAll <TaskInfo>();

        gaidenTaskDic.Clear();
        foreach (var item in allGaidenInfos)
        {
            //init info
            if (!gaidenInfoDic.ContainsKey(item))
            {
                gaidenInfoDic.Add(item, false);
            }

            //init task list
            if (!gaidenTaskDic.ContainsKey(item.taskType))
            {
                gaidenTaskDic.Add(item.taskType, new List <ChaseTask>());
            }
            var ts = allTasks.FindAll(t => t.level == (int)item.taskType);
            if (ts != null && ts.Count > 0)
            {
                foreach (var task in ts)
                {
                    gaidenTaskDic[item.taskType].Add(ChaseTask.Create(task));
                }
            }
        }
    }
Пример #2
0
    private void HandleTasks(PChaseTask[] tasks)
    {
        if (tasks == null)
        {
            return;
        }
        canEnterList.Clear();
        for (var i = 0; i < tasks.Length; i++)
        {
            var t = ConfigManager.Get <TaskInfo>(tasks[i].taskId);
            if (t == null)
            {
                continue;
            }
            var type = moduleChase.GetCurrentTaskType(t);
            if (type != TaskType.Awake)
            {
                continue;
            }
            canEnterList.Add(ChaseTask.Create(tasks[i], t));
        }

        ClassifyList();

        //重新生成了ChaseTask对象,需要重新更新当前任务对象
        var ta = ConfigManager.Get <TaskInfo>(StageId);

        if (ta != null)
        {
            var type = moduleChase.GetCurrentTaskType(ta);
            if (type == TaskType.Awake)
            {
                CurrentTask = CanEnterList.Find(item => item.taskConfigInfo && item.taskConfigInfo.ID == StageId);
            }
            else if (type == TaskType.Nightmare)
            {
                CurrentTask = moduleChase.CanEnterNightmareList.Find(item => item.taskConfigInfo.ID == StageId);
            }
            else if (type == TaskType.Emergency)
            {
                CurrentTask = moduleChase.emergencyList.Find(item => item.taskConfigInfo.ID == StageId);
            }
        }
    }
Пример #3
0
    private void _Packet(ScChaseTaskUnlock p)
    {
        PChaseTask[] tasks = null;
        p.chaseList.CopyTo(ref tasks);

        for (var i = 0; i < tasks?.Length; i++)
        {
            TaskInfo ti    = ConfigManager.Get <TaskInfo>(tasks[i].taskId);
            TaskType _type = moduleChase.GetCurrentTaskType(ti);
            if (_type != TaskType.Awake)
            {
                continue;
            }
            if (!canEnterList.Exists(item => item.taskConfigInfo.ID == ti.ID))
            {
                canEnterList.Add(ChaseTask.Create(tasks[i]));
            }
        }

        ClassifyList();
    }