Commit Graph

15 Commits

Author SHA1 Message Date
zzyyyl
d86e5dc770 refactor: 从 TaskData 中分离 TaskDataSymbol, TaskDataSymbolStream;增加 TaskDataTypes
fix: 用 to_string 和 string 加法取代 std::format 以通过非 win 平台编译

asst::ResultOrError 是 std::expected 的下位替代(同时又类似于 std::optional)
(cherry picked from commit 55875a2eb5)
2023-11-29 19:02:24 +08:00
zzyyyl
3ccc0107d7 Revert "feat: 重构 TaskData (#7410)"
This reverts commit 782e71d4aa, reversing
changes made to 940008b448.
2023-11-29 00:09:10 +08:00
zzyyyl
6b5b0d5ec2 refactor: 优化与 TaskData 的 get_raw 和 get 相关部分
fix: 使用 std::erase & std::erase_if, 避免使用具有不同定义的 ranges::remove & ranges::remove_if

现在 get_raw 只能获取任务的继承信息,其它详细信息会在 get 的时候解析。

另:
- 增加 TaskDerivedType 表示任务的继承类型
- 增加 TaskPipelineInfo 表示任务的流程信息(name + 5个TaskList的任务列表)
- 增加 TaskDerivedInfo 表示任务的继承信息,包含 base & prefix & TaskDerivedType
- 给各个任务类型的 shared_ptr 增加了别名;
2023-11-27 14:59:12 +08:00
zzyyyl
55875a2eb5 refactor: 从 TaskData 中分离 TaskDataSymbol, TaskDataSymbolStream;增加 TaskDataTypes
fix: 用 to_string 和 string 加法取代 std::format 以通过非 win 平台编译

asst::ResultOrError 是 std::expected 的下位替代(同时又类似于 std::optional)
2023-11-27 14:59:12 +08:00
zzyyyl
066a4b3315 rft: 调整 TaskData 的部分内部函数,增加注释 2023-10-18 20:57:07 +08:00
zzyyyl
ba1a62511b feat: 新增三个函数
clear_tasks() 用于清除已生成的任务(一般不需要外部调用)
lazy_parse() 用于在没有新增模板图片时的惰性加载
set_task_base() 用于切换任务
2023-10-01 04:04:46 +08:00
zzyyyl
ad59d59d5d feat: 延迟生成 raw_task (提升加载速度,不影响逻辑) 2023-10-01 04:04:38 +08:00
zzyyyl
af5419a26f feat: 增加接口 get_json(), 运行时可以使用 Task.get_json() 获取任务配置的原生 json 内容 2023-09-30 21:16:36 +08:00
zzyyyl
3e89b4a35e perf: use std::string_view 2023-09-29 00:33:28 +08:00
zzyyyl
7fd753f8a2 feat: 多文件任务从 json 层面合并后再重新解析
现在如果有 CN 任务
```
"base": { "text": [ "CN" ], "next": [ "yyy" ] },
"A": { "baseTask": "base", "next": [ "xxx" ] }
```
只需要在 EN 文件中重新定义 base:
```
"base": { "text": [ "EN" ] }
```
就等价于
```
"base": { "text": [ "EN" ], "next": [ "yyy" ] },
"A": { "text": [ "EN" ], "next": [ "xxx" ] }
```

外服适配不再是难题!
Multi-language adaptation is no longer a problem!
2023-09-29 00:33:20 +08:00
zzyyyl
ef1751e3c2 perf: fix typo 2023-03-18 21:25:05 +08:00
zzyyyl
e6dbaa955c perf: 结构优化 2023-02-22 11:01:53 +08:00
zzyyyl
d681bafeee feat: 简易的任务表达式运算 2023-02-22 11:01:53 +08:00
Horror Proton
90cb0a9519 fix: fix compile error with clang 2022-12-27 01:56:51 +08:00
MistEO
3d83b80dd6 chore: breaking rename 2022-12-02 00:22:47 +08:00