summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Kernel/WorldSave.fs
Commit message (Collapse)AuthorAgeFilesLines
* feat(occupation): P11 存档 v3 today-task 尾段(annals 后追加)+ ↵Somhairle H. Marisol14 days1-33/+118
| | | | | | 双向兼容 Occupation.State 增 Today: DailyTask option(State 声明移至 DailyTask 之后;TaskToken 保留为 v3 前缀占位扩展位)。WorldSave:saveWith 有任务时在 annals 之后追加尾段 task-today|<template>|<state>|<offered>|<due>|npc-none/some|tile-none/some;无任务/无职业不追加(默认 None = 旧行为,v2 逐字节不变)。load 重构为内部 parse 返回 (World, Occupation.State option):尾段可选——旧 v3(P10 版式无尾段)新 reader 读出 Today=None;v1/v2 无任务;尾段后多余 token 或未知模板 token 拒绝(不吞档)。loadFromFileWith 顺手修正:不再经 stateOf 重置,前缀 task/stage 与 Today 全量保真。5 例测试:尾段位置(marker 在 annal 之后)+ 全字段 round-trip + 重存逐字节一致、无任务 v3 旧版式、v1/v2 无尾段 + 未知模板拒绝、尾段后垃圾拒绝、字节级双跑一致。
* feat(occupation): 职业系统第一片 — Kernel 结构 / bootstrap 注入 ↵Somhairle H. Marisol14 days1-4/+68
| | | | | | / 存档 v3 Occupation.fs(Kind/Profile/State + 农夫/渔夫/货郎/书生 中文名常量,按设计 §1 表给初始 Money/Energy/Inventory);ItemKind 扩出 Fish/Spice/Scroll(basePrice 分支补齐,Food 10.0f 数值路径不变 → 无职业 digest 不动);WorldBootstrap.initialWorldWithOccupation 默认 None = 旧行为(Money/Energy 覆盖,库存字段先留数据侧、物理挂接留交易单——取舍见 design §2-C 反对加字段);WorldSave: v3 头仅在有职业时写入(保存 saveToFileWith / loadFromFileWith,v1/v2/v3 无职业类型默认,token 顺序 version|w|h|kind|task|story|…),默认路径 save 输出逐字节等同现行 v2;P10 测试 5 例(§1 表值、v3 round-trip、v1/v2 不吞档、双 seed 逐字节、中文名);Kernel.Tests 引用 Desktop 以驱动 WorldBootstrap(取舍:不做测试专用 shim)。TaskToken/StoryStage 为 v3 占位(任务系统后续单实现)。
* feat(kernel): 地图边界参数化与存档 v2Somhairle H. Marisol14 days1-3/+9
| | | | Sim 地图边界由常量 52 改为可配置(configureBounds,默认 64x48 = 与全部基线一致);Sim.step 裁剪、initialWorld 中心出生时点按当前边界读取;WorldSave 升级 V2 头携带 width/height 两字段,V1 旧存档照常读入并自动回退到 64x48;回归:512x384 边界裁剪/初界转正/双份存档往返/案例 v1 档兼容读。修复前一段中报错已修正的测试代码(Ensure saved-file timeouts)。
* feat(m6a): add file save acceptance smokeSomhairle H. Marisol2026-09-201-2/+4
| | | | | | | | | | | | | | | | | [Change Nature] This commit adds the bounded M6a file-save acceptance path. [New Capability] - Add file-level round-trip and deterministic continuation coverage. - Add Headless --m6a-smoke with digest checks and explicit PASS/FAIL output. [Implementation] - Reject non-finite numeric values and negative inventory quantities. - Exercise dialogue, chat/rumor, trade, events, annals, time, and RNG state. [Impact] - Affects Kernel save parsing, Kernel tests, and Headless smoke tooling. - Preserves the existing save format and M5 smoke behavior.
* feat(m6a): add save speed and day-night controlsSomhairle H. Marisol2026-09-201-0/+533