29 lines
634 B
Standard ML
29 lines
634 B
Standard ML
structure CommonUpdate =
|
|
struct
|
|
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
|
|
|
|
fun getLoadSquaresMsg model =
|
|
(model, [FILE LOAD_SQUARES])
|
|
|
|
(* unimplemented *)
|
|
fun getExportSquaresMsg model = (model, [])
|
|
|
|
fun useSquaresInNormalMode (model, squares) = (model, [])
|
|
|
|
fun squaresLoadError model = (model, [])
|
|
end
|