rust-turn-intent-systems

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rust 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

核心工作流程

  1. Define the allowed turn phases in one enum.
  2. Run different system schedules or branches for input, player resolution, monster resolution, and terminal states.
  3. Convert input and AI decisions into intent components or messages.
  4. Resolve intents in shared systems so players and monsters use the same rules.
  5. Remove or mark intents after processing.
  6. Advance the turn state in one end-turn boundary.
  1. 在一个枚举中定义允许的回合阶段。
  2. 为输入、玩家解析、 怪物解析和终端状态运行不同的系统调度或分支。
  3. 将输入和AI决策转换为意图组件或消息。
  4. 在共享系统中解析意图,确保玩家和怪物遵循相同规则。
  5. 处理完成后移除或标记意图。
  6. 在一个结束回合的边界处推进回合状态。

Read Next

后续阅读

Read
references/turn-intent-patterns.md
for phase design, intent messages, ordering rules, and review checks.
阅读
references/turn-intent-patterns.md
了解阶段设计、意图消息、 排序规则和审查检查内容。

Source 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。