Esempio n. 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);
        }
Esempio n. 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();
        }
Esempio n. 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());
        }
Esempio n. 4
0
 //-------------------------------------------------------------------------
 public TaskDialogue(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Esempio n. 5
0
        //-------------------------------------------------------------------------
        public override TaskBase createTask(TaskData task_data)
        {
            var task = new TaskDialogue(TaskMgr, Entity, task_data);

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

            return(task);
        }
Esempio n. 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();
        }
Esempio n. 17
0
 //-------------------------------------------------------------------------
 public TaskKillMonster(TaskMgr task_mgr, Entity et, TaskData task_data)
     : base(task_mgr, et, task_data)
 {
 }
Esempio n. 18
0
 //-------------------------------------------------------------------------
 public abstract TaskBase createTask(TaskData task_data);
Esempio n. 19
0
 //-------------------------------------------------------------------------
 public abstract TaskBase createTask(TaskData task_data);
Esempio n. 20
0
 //-------------------------------------------------------------------------
 public TaskBase(TaskMgr task_mgr, Entity et, TaskData task_data)
 {
     _init(task_mgr, et, task_data);
 }
Esempio n. 21
0
 //-------------------------------------------------------------------------
 public void clientUpdateTask(TaskData task_data)
 {
     TaskData = task_data;
 }
Esempio n. 22
0
        //-------------------------------------------------------------------------
        public override TaskBase createTask(TaskData task_data)
        {
            var task = new TaskCollectItem(TaskMgr, Entity, task_data);

            return(task);
        }