feat(bindings)!: DungeonFile.fromJson and toBytes #456

Merged
jqueuniet merged 1 commit from feat/454-dungeon-from-json into main 2026-10-31 10:23:38 +01:00
Owner

Closes #454. Stacked on #455.

  • DungeonFile::from_json (wasm DungeonFile.fromJson, C dm2_dungeon_file_from_json, Python DungeonFile.from_json) rebuilds a handle from a to_json dump.
  • to_bytes gives its bytes.
  • The free dungeon_from_json is removed, as the other free functions were.

DungeonFile.fromJson(file.toJson()).toBytes() equals the original on all 11 dungeon.dat fixtures present (every port).

https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7

Closes #454. Stacked on #455. - `DungeonFile::from_json` (wasm `DungeonFile.fromJson`, C `dm2_dungeon_file_from_json`, Python `DungeonFile.from_json`) rebuilds a handle from a `to_json` dump. - `to_bytes` gives its bytes. - The free `dungeon_from_json` is removed, as the other free functions were. `DungeonFile.fromJson(file.toJson()).toBytes()` equals the original on all 11 `dungeon.dat` fixtures present (every port). https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
feat(bindings)!: DungeonFile.fromJson and toBytes
Some checks failed
CI / msrv (1.90) (pull_request) Successful in 35s
CI / stable (pull_request) Successful in 59s
CI / audit (pull_request) Successful in 12s
CI / python bindings (3.11) (pull_request) Successful in 28s
CI / msrv (1.90) (push) Successful in 28s
CI / python bindings (3.11) (push) Has been cancelled
CI / audit (push) Has been cancelled
CI / stable (push) Has been cancelled
3b4c2db5d6
DungeonFile::from_json rebuilds a handle from a to_json dump and
to_bytes gives its bytes, so a dungeon round-trips through the handle
as a save does. The free dungeon_from_json goes from convert, wasm,
FFI and Python. Every port's dungeon.dat fixture round-trips.

Closes #454

Claude-Session: https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
jqueuniet changed target branch from fix/452-wasm-camel-options to main 2026-10-31 10:20:22 +01:00
jqueuniet deleted branch feat/454-dungeon-from-json 2026-10-31 10:23:39 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools!456
No description provided.