/// <summary> /// 通过id创建任务目标 /// </summary> public TaskData createTaskByID(int id, int funcID, int mainID, int num) { if (!CommonSetting.isClientDriveLogic) { Ctrl.throwError("客户端不支持自行创建目标"); } TaskConfig config = TaskConfig.get(id); TaskData taskData = toCreateTaskData(config.type); taskData.id = config.id; taskData.config = config; taskData.funcID = funcID; taskData.mainID = mainID; taskData.num = num; //初始化给值 if (num == 0 && config.initNum > 0) { taskData.num = config.initNum; } taskData.instanceID = ++_d.clientTaskInstanceIDIndex; refreshTaskData(taskData); return(taskData); }
/// <summary> /// 重建任务目标数据(afterRead阶段) /// </summary> public void reMakeTask(TaskData data, int funcID, int mainID) { data.config = TaskConfig.get(data.id); data.funcID = funcID; data.mainID = mainID; refreshTaskData(data); }
public void reloadConfig() { config = TaskConfig.get(id); }