diff --git a/dotscape.mlb b/dotscape.mlb index 716e76a..292199a 100644 --- a/dotscape.mlb +++ b/dotscape.mlb @@ -38,6 +38,7 @@ message-types/file-msg.sml message-types/input-msg.sml message-types/update-msg.sml +fcore/file-string.sml fcore/quad-tree.sml fcore/common-update.sml diff --git a/dsc b/dsc index d536d5d..d437c89 100755 Binary files a/dsc and b/dsc differ diff --git a/fcore/common-update.sml b/fcore/common-update.sml index 98f6ec5..266b495 100644 --- a/fcore/common-update.sml +++ b/fcore/common-update.sml @@ -48,34 +48,37 @@ struct fun getSaveSquaresMsg (model: app_type) = let - val {layerTree, canvasWidth, canvasHeight, ...} = model - val str = + val {layerTree, canvasWidth, canvasHeight, openFilePath, ...} = model + val saveString = CollisionTree.toSaveString (layerTree, canvasWidth, canvasHeight) - val msg = SAVE_SQUARES str + val msg = SAVE_SQUARES {output = saveString, filepath = openFilePath} in (model, [FILE msg]) end - fun getLoadSquaresMsg model = - (model, [FILE LOAD_SQUARES]) + fun getLoadSquaresMsg (model: app_type) = + let val msg = LOAD_SQUARES {filepath = #openFilePath model} + in (model, [FILE msg]) + end fun getExportSquaresMsg (model: app_type) = let - val {layerTree, canvasWidth, canvasHeight, ...} = model + val {layerTree, canvasWidth, canvasHeight, openFilePath, ...} = model val maxSide = Int.max (canvasWidth, canvasHeight) val squares = LayerTree.flatten (maxSide, layerTree) val exportString = CollisionTree.toExportString (squares, canvasWidth, canvasHeight) - val msg = EXPORT_SQUARES exportString + val msg = EXPORT_SQUARES {output = exportString, filepath = openFilePath} in (model, [FILE msg]) end fun getCollisionMsg (model: app_type) = let - val {layerTree, canvasWidth, canvasHeight, modalNum, ...} = model + val {layerTree, canvasWidth, canvasHeight, modalNum, openFilePath, ...} = + model val maxSide = Int.max (canvasWidth, canvasHeight) val squares = LayerTree.flatten (maxSide, layerTree) @@ -83,7 +86,10 @@ struct val exportString = CollisionTree.toCollisionString (squares, canvasWidth, canvasHeight, modalNum) - val msg = EXPORT_COLLISIONS exportString + + val exportFilePath = FileString.getCollisionFilename openFilePath + val msg = + EXPORT_COLLISIONS {output = exportString, filepath = exportFilePath} val model = AppWith.modalNum (model, 0) in diff --git a/fcore/file-string.sml b/fcore/file-string.sml new file mode 100644 index 0000000..f4b3d06 --- /dev/null +++ b/fcore/file-string.sml @@ -0,0 +1,59 @@ +structure FileString = +struct + fun findLastChr (str, pos, findChr) = + if pos < 0 then ~1 + else if String.sub (str, pos) = findChr then pos + else findLastChr (str, pos - 1, findChr) + + fun extractFileName str = + let + val lastSlash = findLastChr (str, String.size str - 1, #"/") + val strStart = lastSlash + 1 + in + if lastSlash = ~1 then str + else String.substring (str, strStart, String.size str - strStart) + end + + fun removeFileExtension str = + let val lastDot = findLastChr (str, String.size str - 1, #".") + in if lastDot = ~1 then str else String.substring (str, 0, lastDot) + end + + local + fun finish acc = + let val acc = List.rev acc + in String.implode acc + end + + (* convert from kebab-case or snake_case to PascalCase *) + fun loop (#"-" :: chr :: tl, acc) = + let val acc = Char.toUpper chr :: acc + in loop (tl, acc) + end + | loop (#"_" :: chr :: tl, acc) = + let val acc = Char.toUpper chr :: acc + in loop (tl, acc) + end + | loop ([#"-"], acc) = finish acc + | loop ([#"_"], acc) = finish acc + | loop (chr :: tl, acc) = + loop (tl, chr :: acc) + | loop ([], acc) = finish acc + in + fun filenameToStructureName str = + let + val str = removeFileExtension str + val str = extractFileName str + in + (* capitalise first character in string *) + case String.explode str of + chr :: tl => let val chr = Char.toUpper chr in loop (tl, [chr]) end + | [] => "" + end + end + + fun getCollisionFilename str = + let val str = removeFileExtension str + in str ^ "-collisions.sml" + end +end diff --git a/fcore/quad-tree.sml b/fcore/quad-tree.sml index 30717ce..d36ef1b 100644 --- a/fcore/quad-tree.sml +++ b/fcore/quad-tree.sml @@ -1,57 +1,5 @@ structure CollisionTree = struct - fun findLastChr (str, pos, findChr) = - if pos < 0 then ~1 - else if String.sub (str, pos) = findChr then pos - else findLastChr (str, pos - 1, findChr) - - fun extractFileName str = - let - val lastSlash = findLastChr (str, String.size str - 1, #"/") - val strStart = lastSlash + 1 - in - if lastSlash = ~1 then str - else String.substring (str, strStart, String.size str - strStart) - end - - local - fun removeFileExtension str = - let val lastDot = findLastChr (str, String.size str - 1, #".") - in if lastDot = ~1 then str else String.substring (str, 0, lastDot) - end - - fun finish acc = - let val acc = List.rev acc - in String.implode acc - end - - (* convert from kebab-case or snake_case to PascalCase *) - fun loop (#"-" :: chr :: tl, acc) = - let val acc = Char.toUpper chr :: acc - in loop (tl, acc) - end - | loop (#"_" :: chr :: tl, acc) = - let val acc = Char.toUpper chr :: acc - in loop (tl, acc) - end - | loop ([#"-"], acc) = finish acc - | loop ([#"_"], acc) = finish acc - | loop (chr :: tl, acc) = - loop (tl, chr :: acc) - | loop ([], acc) = finish acc - in - fun filenameToStructureName str = - let - val str = removeFileExtension str - val str = extractFileName str - in - (* capitalise first character in string *) - case String.explode str of - chr :: tl => let val chr = Char.toUpper chr in loop (tl, [chr]) end - | [] => "" - end - end - structure BinTree = struct datatype 'a bintree = diff --git a/green.dsc b/green.dsc index e16fbe2..103ed82 100644 --- a/green.dsc +++ b/green.dsc @@ -1,3 +1,3 @@ 28 32 { - [ { 0 25 0 26 0 0 0 1 } { 1 7 1 9 0 0 0 1 } { 1 24 5 24 0 0 0 1 } { 1 25 3 25 184 216 248 1 } { 1 26 1 26 120 152 232 1 } { 1 27 5 27 0 0 0 1 } { 2 6 2 6 0 0 0 1 } { 2 7 2 7 184 216 248 1 } { 2 8 2 8 240 248 248 1 } { 2 9 4 9 184 216 248 1 } { 2 10 2 10 0 0 0 1 } { 2 25 2 26 184 216 248 1 } { 3 5 6 5 0 0 0 1 } { 3 6 3 6 184 216 248 1 } { 3 7 3 7 240 248 248 1 } { 3 8 3 10 184 216 248 1 } { 3 8 4 9 184 216 248 1 } { 3 11 3 16 0 0 0 1 } { 3 11 5 11 0 0 0 1 } { 3 26 3 26 120 152 232 1 } { 4 2 4 5 0 0 0 1 } { 4 6 4 6 240 248 248 1 } { 4 7 4 9 184 216 248 1 } { 4 7 5 8 184 216 248 1 } { 4 7 6 7 184 216 248 1 } { 4 10 4 10 120 152 232 1 } { 4 12 5 16 184 216 248 1 } { 4 14 9 16 184 216 248 1 } { 4 14 10 15 184 216 248 1 } { 4 17 4 18 0 0 0 1 } { 4 25 4 25 120 152 232 1 } { 4 26 5 26 64 96 184 1 } { 5 1 5 1 0 0 0 1 } { 5 2 5 2 120 152 232 1 } { 5 3 5 3 184 216 248 1 } { 5 4 6 4 120 152 232 1 } { 5 6 5 8 184 216 248 1 } { 5 9 5 9 120 152 232 1 } { 5 10 5 10 104 128 216 1 } { 5 12 5 18 184 216 248 1 } { 5 14 6 18 184 216 248 1 } { 5 14 8 17 184 216 248 1 } { 5 19 5 20 0 0 0 1 } { 5 25 5 26 64 96 184 1 } { 6 0 8 0 0 0 0 1 } { 6 1 6 1 120 152 232 1 } { 6 2 6 2 184 216 248 1 } { 6 3 6 4 120 152 232 1 } { 6 5 6 6 0 0 0 1 } { 6 8 6 8 120 152 232 1 } { 6 9 6 9 104 128 216 1 } { 6 10 6 10 0 0 0 1 } { 6 11 6 13 104 128 216 1 } { 6 14 6 19 184 216 248 1 } { 6 20 10 20 240 248 248 1 } { 6 21 6 21 0 0 0 1 } { 6 25 6 26 0 0 0 1 } { 7 1 7 1 184 216 248 1 } { 7 2 7 3 120 152 232 1 } { 7 2 9 2 120 152 232 1 } { 7 4 7 4 0 0 0 1 } { 7 5 19 6 184 216 248 1 } { 7 7 7 9 0 0 0 1 } { 7 10 8 17 184 216 248 1 } { 7 18 7 18 104 128 216 1 } { 7 19 9 21 240 248 248 1 } { 7 22 7 22 0 0 0 1 } { 8 1 8 2 120 152 232 1 } { 8 3 10 3 0 0 0 1 } { 8 4 8 17 184 216 248 1 } { 8 4 13 9 184 216 248 1 } { 8 4 21 4 184 216 248 1 } { 8 18 8 22 240 248 248 1 } { 8 18 9 21 240 248 248 1 } { 8 18 10 20 240 248 248 1 } { 8 23 9 23 0 0 0 1 } { 9 1 9 1 0 0 0 1 } { 9 10 9 13 104 128 216 1 } { 9 17 9 21 240 248 248 1 } { 9 17 10 20 240 248 248 1 } { 9 17 13 17 240 248 248 1 } { 9 22 19 22 184 216 248 1 } { 10 2 10 3 0 0 0 1 } { 10 2 11 2 0 0 0 1 } { 10 4 10 15 184 216 248 1 } { 10 4 11 11 184 216 248 1 } { 10 4 12 10 184 216 248 1 } { 10 16 10 20 240 248 248 1 } { 10 16 11 19 240 248 248 1 } { 10 16 12 18 240 248 248 1 } { 10 21 17 23 184 216 248 1 } { 10 24 11 24 0 0 0 1 } { 11 3 11 11 184 216 248 1 } { 11 3 12 10 184 216 248 1 } { 11 3 19 6 184 216 248 1 } { 11 3 20 5 184 216 248 1 } { 11 12 11 14 0 0 0 1 } { 11 15 11 19 240 248 248 1 } { 11 20 17 23 184 216 248 1 } { 12 1 18 1 0 0 0 1 } { 12 2 12 10 184 216 248 1 } { 12 2 13 9 184 216 248 1 } { 12 2 17 8 184 216 248 1 } { 12 2 18 7 184 216 248 1 } { 12 11 12 11 0 0 0 1 } { 12 15 12 15 0 0 0 1 } { 12 19 16 24 184 216 248 1 } { 12 25 18 25 0 0 0 1 } { 13 10 13 10 0 0 0 1 } { 13 16 13 16 0 0 0 1 } { 13 18 16 24 184 216 248 1 } { 13 18 17 23 184 216 248 1 } { 13 18 19 22 184 216 248 1 } { 14 9 16 9 0 0 0 1 } { 14 17 16 17 0 0 0 1 } { 17 9 21 9 240 248 248 1 } { 17 10 17 10 0 0 0 1 } { 17 16 17 16 0 0 0 1 } { 17 17 17 23 184 216 248 1 } { 17 17 19 22 184 216 248 1 } { 17 24 17 24 120 152 232 1 } { 17 29 17 30 0 0 0 1 } { 18 8 20 10 240 248 248 1 } { 18 11 18 11 0 0 0 1 } { 18 15 18 15 0 0 0 1 } { 18 16 19 22 184 216 248 1 } { 18 16 21 21 184 216 248 1 } { 18 23 19 23 120 152 232 1 } { 18 24 18 24 104 128 216 1 } { 18 28 22 28 0 0 0 1 } { 18 29 20 29 240 248 248 1 } { 18 30 18 30 184 216 248 1 } { 18 31 22 32 0 0 0 1 } { 19 2 20 2 0 0 0 1 } { 19 7 19 11 240 248 248 1 } { 19 7 20 10 240 248 248 1 } { 19 12 19 14 0 0 0 1 } { 19 15 19 22 184 216 248 1 } { 19 15 21 21 184 216 248 1 } { 19 24 20 24 0 0 0 1 } { 19 29 19 30 240 248 248 1 } { 20 6 20 10 240 248 248 1 } { 20 6 21 9 240 248 248 1 } { 20 6 22 8 240 248 248 1 } { 20 6 24 6 240 248 248 1 } { 20 11 21 21 184 216 248 1 } { 20 11 22 20 184 216 248 1 } { 20 11 24 17 184 216 248 1 } { 20 22 21 22 120 152 232 1 } { 20 23 20 23 104 128 216 1 } { 20 30 20 30 184 216 248 1 } { 21 3 22 3 0 0 0 1 } { 21 5 21 9 240 248 248 1 } { 21 5 22 8 240 248 248 1 } { 21 5 23 7 240 248 248 1 } { 21 10 21 21 184 216 248 1 } { 21 10 22 20 184 216 248 1 } { 21 10 26 13 184 216 248 1 } { 21 23 22 23 0 0 0 1 } { 21 29 21 29 184 216 248 1 } { 21 30 22 30 120 152 232 1 } { 22 4 22 8 240 248 248 1 } { 22 9 22 20 184 216 248 1 } { 22 9 23 19 184 216 248 1 } { 22 9 24 17 184 216 248 1 } { 22 21 22 21 120 152 232 1 } { 22 22 22 22 104 128 216 1 } { 22 29 22 30 120 152 232 1 } { 23 4 23 4 0 0 0 1 } { 23 8 23 19 184 216 248 1 } { 23 8 24 17 184 216 248 1 } { 23 8 25 15 184 216 248 1 } { 23 20 23 20 120 152 232 1 } { 23 21 23 21 104 128 216 1 } { 23 22 23 22 0 0 0 1 } { 23 29 23 30 0 0 0 1 } { 24 5 24 5 0 0 0 1 } { 24 7 24 17 184 216 248 1 } { 24 18 24 19 120 152 232 1 } { 24 20 24 20 104 128 216 1 } { 24 21 24 21 0 0 0 1 } { 25 6 25 7 0 0 0 1 } { 25 16 25 17 120 152 232 1 } { 25 18 25 18 104 128 216 1 } { 25 19 25 20 0 0 0 1 } { 26 8 26 9 0 0 0 1 } { 26 14 26 15 120 152 232 1 } { 26 16 26 16 104 128 216 1 } { 26 17 26 18 0 0 0 1 } { 27 10 27 16 0 0 0 1 } ] + [ { 0 0 0 0 0 0 0 1 } { 0 25 0 26 0 0 0 1 } { 1 7 1 9 0 0 0 1 } { 1 24 5 24 0 0 0 1 } { 1 25 3 25 184 216 248 1 } { 1 26 1 26 120 152 232 1 } { 1 27 5 27 0 0 0 1 } { 2 6 2 6 0 0 0 1 } { 2 7 2 7 184 216 248 1 } { 2 8 2 8 240 248 248 1 } { 2 9 4 9 184 216 248 1 } { 2 10 2 10 0 0 0 1 } { 2 25 2 26 184 216 248 1 } { 3 5 6 5 0 0 0 1 } { 3 6 3 6 184 216 248 1 } { 3 7 3 7 240 248 248 1 } { 3 8 3 10 184 216 248 1 } { 3 8 4 9 184 216 248 1 } { 3 11 3 16 0 0 0 1 } { 3 11 5 11 0 0 0 1 } { 3 26 3 26 120 152 232 1 } { 4 2 4 5 0 0 0 1 } { 4 6 4 6 240 248 248 1 } { 4 7 4 9 184 216 248 1 } { 4 7 5 8 184 216 248 1 } { 4 7 6 7 184 216 248 1 } { 4 10 4 10 120 152 232 1 } { 4 12 5 16 184 216 248 1 } { 4 14 9 16 184 216 248 1 } { 4 14 10 15 184 216 248 1 } { 4 17 4 18 0 0 0 1 } { 4 25 4 25 120 152 232 1 } { 4 26 5 26 64 96 184 1 } { 5 1 5 1 0 0 0 1 } { 5 2 5 2 120 152 232 1 } { 5 3 5 3 184 216 248 1 } { 5 4 6 4 120 152 232 1 } { 5 6 5 8 184 216 248 1 } { 5 9 5 9 120 152 232 1 } { 5 10 5 10 104 128 216 1 } { 5 12 5 18 184 216 248 1 } { 5 14 6 18 184 216 248 1 } { 5 14 8 17 184 216 248 1 } { 5 19 5 20 0 0 0 1 } { 5 25 5 26 64 96 184 1 } { 6 0 8 0 0 0 0 1 } { 6 1 6 1 120 152 232 1 } { 6 2 6 2 184 216 248 1 } { 6 3 6 4 120 152 232 1 } { 6 5 6 6 0 0 0 1 } { 6 8 6 8 120 152 232 1 } { 6 9 6 9 104 128 216 1 } { 6 10 6 10 0 0 0 1 } { 6 11 6 13 104 128 216 1 } { 6 14 6 19 184 216 248 1 } { 6 20 10 20 240 248 248 1 } { 6 21 6 21 0 0 0 1 } { 6 25 6 26 0 0 0 1 } { 7 1 7 1 184 216 248 1 } { 7 2 7 3 120 152 232 1 } { 7 2 9 2 120 152 232 1 } { 7 4 7 4 0 0 0 1 } { 7 5 19 6 184 216 248 1 } { 7 7 7 9 0 0 0 1 } { 7 10 8 17 184 216 248 1 } { 7 18 7 18 104 128 216 1 } { 7 19 9 21 240 248 248 1 } { 7 22 7 22 0 0 0 1 } { 8 1 8 2 120 152 232 1 } { 8 3 10 3 0 0 0 1 } { 8 4 8 17 184 216 248 1 } { 8 4 13 9 184 216 248 1 } { 8 4 21 4 184 216 248 1 } { 8 18 8 22 240 248 248 1 } { 8 18 9 21 240 248 248 1 } { 8 18 10 20 240 248 248 1 } { 8 23 9 23 0 0 0 1 } { 9 1 9 1 0 0 0 1 } { 9 10 9 13 104 128 216 1 } { 9 17 9 21 240 248 248 1 } { 9 17 10 20 240 248 248 1 } { 9 17 13 17 240 248 248 1 } { 9 22 19 22 184 216 248 1 } { 10 2 10 3 0 0 0 1 } { 10 2 11 2 0 0 0 1 } { 10 4 10 15 184 216 248 1 } { 10 4 11 11 184 216 248 1 } { 10 4 12 10 184 216 248 1 } { 10 16 10 20 240 248 248 1 } { 10 16 11 19 240 248 248 1 } { 10 16 12 18 240 248 248 1 } { 10 21 17 23 184 216 248 1 } { 10 24 11 24 0 0 0 1 } { 11 3 11 11 184 216 248 1 } { 11 3 12 10 184 216 248 1 } { 11 3 19 6 184 216 248 1 } { 11 3 20 5 184 216 248 1 } { 11 12 11 14 0 0 0 1 } { 11 15 11 19 240 248 248 1 } { 11 20 17 23 184 216 248 1 } { 12 1 18 1 0 0 0 1 } { 12 2 12 10 184 216 248 1 } { 12 2 13 9 184 216 248 1 } { 12 2 17 8 184 216 248 1 } { 12 2 18 7 184 216 248 1 } { 12 11 12 11 0 0 0 1 } { 12 15 12 15 0 0 0 1 } { 12 19 16 24 184 216 248 1 } { 12 25 18 25 0 0 0 1 } { 13 10 13 10 0 0 0 1 } { 13 16 13 16 0 0 0 1 } { 13 18 16 24 184 216 248 1 } { 13 18 17 23 184 216 248 1 } { 13 18 19 22 184 216 248 1 } { 14 9 16 9 0 0 0 1 } { 14 17 16 17 0 0 0 1 } { 17 9 21 9 240 248 248 1 } { 17 10 17 10 0 0 0 1 } { 17 16 17 16 0 0 0 1 } { 17 17 17 23 184 216 248 1 } { 17 17 19 22 184 216 248 1 } { 17 24 17 24 120 152 232 1 } { 17 29 17 30 0 0 0 1 } { 18 8 20 10 240 248 248 1 } { 18 11 18 11 0 0 0 1 } { 18 15 18 15 0 0 0 1 } { 18 16 19 22 184 216 248 1 } { 18 16 21 21 184 216 248 1 } { 18 23 19 23 120 152 232 1 } { 18 24 18 24 104 128 216 1 } { 18 28 22 28 0 0 0 1 } { 18 29 20 29 240 248 248 1 } { 18 30 18 30 184 216 248 1 } { 18 31 22 32 0 0 0 1 } { 19 2 20 2 0 0 0 1 } { 19 7 19 11 240 248 248 1 } { 19 7 20 10 240 248 248 1 } { 19 12 19 14 0 0 0 1 } { 19 15 19 22 184 216 248 1 } { 19 15 21 21 184 216 248 1 } { 19 24 20 24 0 0 0 1 } { 19 29 19 30 240 248 248 1 } { 20 6 20 10 240 248 248 1 } { 20 6 21 9 240 248 248 1 } { 20 6 22 8 240 248 248 1 } { 20 6 24 6 240 248 248 1 } { 20 11 21 21 184 216 248 1 } { 20 11 22 20 184 216 248 1 } { 20 11 24 17 184 216 248 1 } { 20 22 21 22 120 152 232 1 } { 20 23 20 23 104 128 216 1 } { 20 30 20 30 184 216 248 1 } { 21 3 22 3 0 0 0 1 } { 21 5 21 9 240 248 248 1 } { 21 5 22 8 240 248 248 1 } { 21 5 23 7 240 248 248 1 } { 21 10 21 21 184 216 248 1 } { 21 10 22 20 184 216 248 1 } { 21 10 26 13 184 216 248 1 } { 21 23 22 23 0 0 0 1 } { 21 29 21 29 184 216 248 1 } { 21 30 22 30 120 152 232 1 } { 22 4 22 8 240 248 248 1 } { 22 9 22 20 184 216 248 1 } { 22 9 23 19 184 216 248 1 } { 22 9 24 17 184 216 248 1 } { 22 21 22 21 120 152 232 1 } { 22 22 22 22 104 128 216 1 } { 22 29 22 30 120 152 232 1 } { 23 4 23 4 0 0 0 1 } { 23 8 23 19 184 216 248 1 } { 23 8 24 17 184 216 248 1 } { 23 8 25 15 184 216 248 1 } { 23 20 23 20 120 152 232 1 } { 23 21 23 21 104 128 216 1 } { 23 22 23 22 0 0 0 1 } { 23 29 23 30 0 0 0 1 } { 24 5 24 5 0 0 0 1 } { 24 7 24 17 184 216 248 1 } { 24 18 24 19 120 152 232 1 } { 24 20 24 20 104 128 216 1 } { 24 21 24 21 0 0 0 1 } { 25 6 25 7 0 0 0 1 } { 25 16 25 17 120 152 232 1 } { 25 18 25 18 104 128 216 1 } { 25 19 25 20 0 0 0 1 } { 26 8 26 9 0 0 0 1 } { 26 14 26 15 120 152 232 1 } { 26 16 26 16 104 128 216 1 } { 26 17 26 18 0 0 0 1 } { 27 10 27 16 0 0 0 1 } ] } diff --git a/imperative-shell/file-thread.sml b/imperative-shell/file-thread.sml index 3dcec95..98f2cf2 100644 --- a/imperative-shell/file-thread.sml +++ b/imperative-shell/file-thread.sml @@ -49,10 +49,10 @@ struct let val _ = case Mailbox.recv fileMailbox of - SAVE_SQUARES str => saveString (filename, str) - | EXPORT_SQUARES str => saveString (exportFilename, str) - | EXPORT_COLLISIONS str => saveString (collisionFilename, str) - | LOAD_SQUARES => loadSquares (filename, inputMailbox) + SAVE_SQUARES {filepath, output} => saveString (filepath, output) + | EXPORT_SQUARES {filepath, output} => saveString (filepath, output) + | EXPORT_COLLISIONS {filepath, output} => saveString (filepath, output) + | LOAD_SQUARES filename => loadSquares (filename, inputMailbox) in run (fileMailbox, inputMailbox) end diff --git a/message-types/file-msg.sml b/message-types/file-msg.sml index d2a966d..50dace2 100644 --- a/message-types/file-msg.sml +++ b/message-types/file-msg.sml @@ -1,8 +1,8 @@ structure FileMessage = struct datatype t = - SAVE_SQUARES of string - | LOAD_SQUARES - | EXPORT_SQUARES of string - | EXPORT_COLLISIONS of string + SAVE_SQUARES of {output: string, filepath: string} + | LOAD_SQUARES of {filepath: string} + | EXPORT_SQUARES of {output: string, filepath: string} + | EXPORT_COLLISIONS of {output: string, filepath: string} end