rust-turn-intent-systems
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRust Turn Intent Systems
Rust 回合意图系统
Use this skill to make turn-based gameplay deterministic and easy to extend.
Separate decision systems from resolution systems: input and AI create intents;
movement, combat, inventory, and end-turn systems resolve them.
使用此技能可让回合制游戏玩法具备确定性且易于扩展。
将决策系统与解析系统分离:输入和AI生成意图;
移动、战斗、物品栏和结束回合系统负责解析这些意图。
Core Workflow
核心工作流程
- Define the allowed turn phases in one enum.
- Run different system schedules or branches for input, player resolution, monster resolution, and terminal states.
- Convert input and AI decisions into intent components or messages.
- Resolve intents in shared systems so players and monsters use the same rules.
- Remove or mark intents after processing.
- Advance the turn state in one end-turn boundary.
- 在一个枚举中定义允许的回合阶段。
- 为输入、玩家解析、 怪物解析和终端状态运行不同的系统调度或分支。
- 将输入和AI决策转换为意图组件或消息。
- 在共享系统中解析意图,确保玩家和怪物遵循相同规则。
- 处理完成后移除或标记意图。
- 在一个结束回合的边界处推进回合状态。
Read Next
后续阅读
Read for phase design, intent messages,
ordering rules, and review checks.
references/turn-intent-patterns.md阅读了解阶段设计、意图消息、
排序规则和审查检查内容。
references/turn-intent-patterns.mdSource Notes
来源说明
Guidance is transformed and paraphrased from Hands-On Rust Chapters 7, 8,
9, and 13 and from the official companion source repository. The patterns are
generalized for Rust ECS projects and do not require using Legion.
本指南改编自《Hands-On Rust》第7、8、9和13章以及官方配套源码仓库。这些模式已针对Rust ECS项目进行通用化处理,无需使用Legion。