save grid to custom format

This commit is contained in:
2025-07-12 06:03:59 +01:00
parent 04bb7a18c0
commit eb0b8d31b2
6 changed files with 41 additions and 15 deletions

View File

@@ -1,8 +1,22 @@
structure CommonUpdate =
struct
(* unimplemented *)
fun getSaveSquaresMsg model = (model, [])
open AppType
open DrawMessage
open FileMessage
open InputMessage
open UpdateMessage
fun getSaveSquaresMsg (model: app_type) =
let
val {canvasWidth, canvasHeight, squares, ...} = model
val str = CollisionTree.toString (squares, canvasWidth, canvasHeight)
val msg = SAVE_SQUARES str
in
(model, [FILE msg])
end
(* unimplemented *)
fun getLoadSquaresMsg model = (model, [])
fun getExportSquaresMsg model = (model, [])