bindings: SaveGame without dungeon.dat and graphics.dat #453
Labels
No labels
area/ci-release
area/cli
area/docs
area/dungeon
area/ftl
area/graphics
area/gui
area/music
area/saves
area/tooling
port/amiga
port/dos
port/fm-towns
port/mac
port/pc98
port/sega-cd
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jqueuniet/dm2-tools#453
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A save opened without its
dungeon.datandgraphics.dathas no handle: it still goes throughsaveToJson,saveFromJsonandsaveFieldLimitsJson, the last one duplicatingSaveGame.fieldLimits. Consumers keep two code paths for one file type.Proposal
A
SaveGamethat can open without context (e.g. aSaveGame.limited(bytes)constructor, or optional context arguments):toJson,toBytes,gameplay,setGameplayandfieldLimitswork; item methods refuse. Context can be supplied later, reloading the save as edited so far.Acceptance
SaveGamealone.Deviations in #458:
SaveGame.limited(bytes)andSaveGame.limitedFromJson(json)instead of optional context arguments. wasm-bindgen 0.2.129 cannot takeOption<&DungeonFile>.SaveGame(data),SaveGame.from_json(dump)). C hasdm2_save_game_open_limitedanddm2_save_game_from_json_limited.attach(dungeon, graphics)does it. It refuses a save that already has its files (ContextAttached) and leaves the save unchanged on a mismatch.hasContext()tells the two states apart.save_to_json,save_from_jsonandsave_field_limits_jsonare removed.save_info_json, the lossy gameplay-only view, stays free; it could become aSaveGamemethod later.https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7