Пример #1
0
 internal void _OnTaskGoing(GameTask gt)
 {
     if (this.OnTaskGoing != null)
     {
         this.OnTaskGoing(gt);
     }
 }
Пример #2
0
 internal void _OnTaskReady(GameTask gt)
 {
     if (this.OnTaskReady != null)
     {
         this.OnTaskReady(gt);
     }
 }
Пример #3
0
 internal void _OnTaskClose(GameTask gt)
 {
     if (null != this._actionHelper)
     {
         this._actionHelper.PlayAction(gt.CloseAction);
     }
     if (this.OnTaskClose != null)
     {
         this.OnTaskClose(gt);
     }
 }
Пример #4
0
 internal void _OnTaskStart(GameTask gt)
 {
     if (null != this._actionHelper)
     {
         this._actionHelper.PlayAction(gt.StartAction);
     }
     if (this.OnTaskStart != null)
     {
         this.OnTaskStart(gt);
     }
 }
Пример #5
0
        public GameTask AddTask(uint taskId, bool autoStart)
        {
            if (this._taskDict.ContainsKey(taskId))
            {
                return(this._taskDict.get_Item(taskId));
            }
            GameTask gameTask = this.CreateTask(taskId);

            if (gameTask != null)
            {
                this._taskDict.Add(taskId, gameTask);
                if (autoStart)
                {
                    gameTask.Start();
                }
            }
            return(gameTask);
        }
Пример #6
0
        internal void _OnChildClosed(GameTask et)
        {
            int  num  = 0;
            int  num2 = 0;
            int  num3 = -1;
            bool flag = false;

            for (int i = 0; i < this._taskList.Count; i++)
            {
                TaskNode node = this._taskList[i];
                if (node.task.Closed)
                {
                    num2++;
                    if (node.task.Achieving == node.achieve)
                    {
                        num++;
                    }
                }
                if (node.task == et)
                {
                    num3 = i;
                    flag = et.Achieving == node.achieve;
                }
            }
            if (num3 != -1)
            {
                base.Current = num;
                if (!base.Closed)
                {
                    if ((num2 >= this._taskList.Count) || (et.Closed && ((flag && (this.CloseType == RES_GAME_TASK_GROUP_CLOSE_TYPE.ACHIEVE_ONE)) || (!flag && (this.CloseType == RES_GAME_TASK_GROUP_CLOSE_TYPE.ACHIEVE_ALL)))))
                    {
                        base.Close();
                    }
                    else if ((this.StartType == RES_GAME_TASK_GROUP_START_TYPE.ONEBYONE) && (++num3 < this._taskList.Count))
                    {
                        TaskNode node2 = this._taskList[num3];
                        node2.task.Start();
                    }
                }
            }
        }
Пример #7
0
        internal void _OnChildClosed(GameTask et)
        {
            int  num  = 0;
            int  num2 = 0;
            int  num3 = -1;
            bool flag = false;

            for (int i = 0; i < this._taskList.get_Count(); i++)
            {
                GameTaskGroup.TaskNode taskNode = this._taskList.get_Item(i);
                if (taskNode.task.Closed)
                {
                    num2++;
                    if (taskNode.task.Achieving == taskNode.achieve)
                    {
                        num++;
                    }
                }
                if (taskNode.task == et)
                {
                    num3 = i;
                    flag = (et.Achieving == taskNode.achieve);
                }
            }
            if (num3 != -1)
            {
                base.Current = num;
                if (!base.Closed)
                {
                    if (num2 >= this._taskList.get_Count() || (et.Closed && ((flag && this.CloseType == 1) || (!flag && this.CloseType == null))))
                    {
                        base.Close();
                    }
                    else if (this.StartType == null && ++num3 < this._taskList.get_Count())
                    {
                        this._taskList.get_Item(num3).task.Start();
                    }
                }
            }
        }
Пример #8
0
        private GameTask CreateTask(uint taskId)
        {
            ResGameTask dataByKey = this._taskDB.GetDataByKey(taskId);

            if (dataByKey == null)
            {
                return(null);
            }
            GameTask task2 = null;
            string   str   = Utility.UTF8Convert(dataByKey.szType);

            if ("Group" == str)
            {
                task2 = new GameTaskGroup();
            }
            else
            {
                task2 = (GameTask)Assembly.GetExecutingAssembly().CreateInstance(this._classSpace + ".GameTask" + str);
            }
            task2.Initial(dataByKey, this);
            return(task2);
        }