Exemple #1
0
        void ReStartTask(int curTaskId)
        {
            CTaskManagerData curTask = ConfigReader.GetManagerTaskInfo(curTaskId);

            if (curTask == null)
            {
                return;
            }
            GuideTaskReConnectDeal.Instance.StartReConnectTask(curTaskId);
            GuideTaskReConnectDeal.Instance.DealReConnectTask();
            // return;
            //reConnectTaskId = curTask.ReConnectId;
            //CTaskManagerData newTask = new CTaskManagerData();
            //newTask.TaskTypeSet = new List<GuideTaskType>();
            //newTask.TaskTypeSet.Add(GuideTaskType.PathTask);
            //newTask.SonTaskIdSet = new List<int>();
            //newTask.SonTaskIdSet.Add(reConnectTaskId);
            //newTask.MeetCheck = TaskCheckType.PartMeetCheck;
            //newTask.EndTaskSet = new List<int>();
            //newTask.EndTaskSet.Add(0);
            //currentTaskId = curTask.TaskId;
            //reConnectTask = new GuideTaskManager(newTask);
            //reConnectTask.SetTaskState(GuideTaskManager.TaskState.EnterState);
            //reConnectTask.SetTaskState(GuideTaskManager.TaskState.CheckState);
            //reConnectTask.FinishEvent += FinishReConnect;
        }
Exemple #2
0
        public virtual void SetTaskStart(int taskId)
        {
            CTaskManagerData data = ConfigReader.GetManagerTaskInfo(taskId);

            if (data == null)
            {
                return;
            }
            currentTaskId = taskId;
            currentTask   = new GuideTaskManager(data);
            currentTask.SetTaskState(GuideTaskManager.TaskState.EnterState);
            currentTask.SetTaskState(GuideTaskManager.TaskState.CheckState);
            currentTask.FinishEvent += FinishCurrentTask;
        }
 public void CleanAllTask()
 {
     if (taskList == null || taskList.Count == 0)
     {
         return;
     }
     foreach (var item in taskList)
     {
         if (item.IsFinish())
         {
             continue;
         }
         item.ClearTask();
     }
     taskData  = null;
     taskState = TaskState.NoneState;
     taskList.Clear();
     taskList = null;
 }
 void FinishTask()
 {
     foreach (var item in taskList)
     {
         if (item.IsFinish())
         {
             continue;
         }
         item.ClearTask();
     }
     taskData  = null;
     taskState = TaskState.NoneState;
     taskList.Clear();
     taskList = null;
     if (FinishEvent != null)
     {
         FinishEvent();
     }
 }
 public void DealReConnectTask()
 {
     for (int i = 0; i < taskList.IndexOf(reTaskId); i++)
     {
         CTaskManagerData data = CTaskBase.managerTaskDic.ElementAt(i).Value;
         for (int j = 0; j < data.TaskTypeSet.Count; j++)
         {
             if (data.TaskTypeSet.ElementAt(j) == GuideTaskType.ObjShowTask)
             {
                 AddShowObjTaskList(j, data);
             }
             //else if(data.TaskTypeSet.ElementAt(j) == GuideTaskType.SenderSoldier){
             //    AddSendNpcTaskList(j, data);
             //}
         }
     }
     ShowObj();
     //   SendNpc();
 }
        private void AddShowObjTaskList(int index, CTaskManagerData taskData)
        {
            int showTaskId = taskData.SonTaskIdSet.ElementAt(index);
            CGameObjectShowTask showTask = ConfigReader.GetObjShowTaskInfo(showTaskId);
            bool show = showTask.EndShow == 1? true:false;

            if (showObjDic.ContainsKey(showTask.Path))
            {
                ShowObjInfo info = showObjDic[showTask.Path];
                info.show = show;
                showObjDic[showTask.Path] = info;
            }
            else
            {
                ShowObjInfo info = new ShowObjInfo();
                info.show   = show;
                info.TaskId = showTaskId;
                showObjDic.Add(showTask.Path, info);
            }
        }
 public GuideTaskManager(CTaskManagerData data)
 {
     taskData  = data;
     taskState = TaskState.NoneState;
     taskList.Clear();
 }