Пример #1
0
        //-------------------------------------------------------------------------
        public TaskBase(TaskMgr task_mgr, Entity et, int task_id)
        {
            TaskData task_data = new TaskData();
            task_data.task_id = task_id;
            task_data.task_state = TaskState.Init;
            task_data.task_data = new Dictionary<byte, string>();

            _init(task_mgr, et, task_data);
        }
Пример #2
0
        //-------------------------------------------------------------------------
        void _init(TaskMgr task_mgr, Entity et, TaskData task_data)
        {
            TaskMgr = task_mgr;
            Entity  = et;

            TaskData = task_data;
            if (TaskData.task_data == null)
            {
                TaskData.task_data = new Dictionary <byte, string>();
            }

            TbDataTask = EbDataMgr.Instance.getData <TbDataTask>(TaskData.task_id);

            onInit();
        }
Пример #3
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            CoActor  = Entity.getComponent <CellActor <DefActor> >();
            CoPlayer = Entity.getComponent <CellPlayer <DefPlayer> >();
            if (CoActor.Def.mPropIsBot.get())
            {
                return;
            }

            TaskMgr = new TaskMgr(Entity, false);
            TaskMgr.regTaskFactory(new TaskFactoryCollectItem());
            TaskMgr.regTaskFactory(new TaskFactoryDialogue());
            TaskMgr.regTaskFactory(new TaskFactoryKillMonster());
            TaskMgr.OnServerTaskAward = _onTaskAward;

            if (Def.mPropFirstRun.get())
            {
                // 读取任务配置文件
                List <int> list_taskstory_starttasyid = CellApp.Instance.Cfg.ListTaskStoryStartTaskId;

                List <TaskData> list_taskdata = Def.mPropListTaskData.get();
                if (list_taskdata.Count == 0)
                {
                    foreach (var i in list_taskstory_starttasyid)
                    {
                        TaskData td = new TaskData();
                        td.task_id    = i;
                        td.task_data  = new Dictionary <byte, string>();
                        td.task_state = TaskState.Init;
                        list_taskdata.Add(td);
                    }
                }

                Def.mPropFirstRun.set(true);
            }

            TaskMgr.loadAllTask(Def.mPropListTaskData.get());
        }
Пример #4
0
 //-------------------------------------------------------------------------
 public TaskDialogue(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Пример #5
0
        //-------------------------------------------------------------------------
        public override TaskBase createTask(TaskData task_data)
        {
            var task = new TaskDialogue(TaskMgr, Entity, task_data);

            return(task);
        }
Пример #6
0
 //-------------------------------------------------------------------------
 public TaskCollectItem(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Пример #7
0
 //-------------------------------------------------------------------------
 public TaskBase(TaskMgr task_mgr, Entity et, TaskData task_data)
 {
     _init(task_mgr, et, task_data);
 }
Пример #8
0
 //-------------------------------------------------------------------------
 public override TaskBase createTask(TaskData task_data)
 {
     var task = new TaskDialogue(TaskMgr, Entity, task_data);
     return task;
 }
Пример #9
0
 //-------------------------------------------------------------------------
 public void clientUpdateTask(TaskData task_data)
 {
     TaskData = task_data;
 }
Пример #10
0
 //-------------------------------------------------------------------------
 public TaskCollectItem(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Пример #11
0
 //-------------------------------------------------------------------------
 public TaskDialogue(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Пример #12
0
 //-------------------------------------------------------------------------
 public override TaskBase createTask(TaskData task_data)
 {
     var task = new TaskCollectItem(TaskMgr, Entity, task_data);
     return task;
 }
Пример #13
0
 //-------------------------------------------------------------------------
 public TaskKillMonster(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Пример #14
0
 //-------------------------------------------------------------------------
 public override TaskBase createTask(TaskData task_data)
 {
     var task = new TaskKillMonster(TaskMgr, Entity, task_data);
     return task;
 }
Пример #15
0
        //-------------------------------------------------------------------------
        public override TaskBase createTask(TaskData task_data)
        {
            var task = new TaskKillMonster(TaskMgr, Entity, task_data);

            return(task);
        }
Пример #16
0
        //-------------------------------------------------------------------------
        void _init(TaskMgr task_mgr, Entity et, TaskData task_data)
        {
            TaskMgr = task_mgr;
            Entity = et;

            TaskData = task_data;
            if (TaskData.task_data == null) TaskData.task_data = new Dictionary<byte, string>();

            TbDataTask = EbDataMgr.Instance.getData<TbDataTask>(TaskData.task_id);

            onInit();
        }
Пример #17
0
 //-------------------------------------------------------------------------
 public TaskKillMonster(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Пример #18
0
 //-------------------------------------------------------------------------
 public abstract TaskBase createTask(TaskData task_data);
Пример #19
0
 //-------------------------------------------------------------------------
 public abstract TaskBase createTask(TaskData task_data);
Пример #20
0
 //-------------------------------------------------------------------------
 public TaskBase(TaskMgr task_mgr, Entity et, TaskData task_data)
 {
     _init(task_mgr, et, task_data);
 }
Пример #21
0
 //-------------------------------------------------------------------------
 public void clientUpdateTask(TaskData task_data)
 {
     TaskData = task_data;
 }
Пример #22
0
        //-------------------------------------------------------------------------
        public override TaskBase createTask(TaskData task_data)
        {
            var task = new TaskCollectItem(TaskMgr, Entity, task_data);

            return(task);
        }