piecesPerPoint

This commit is contained in:
2022-08-10 20:25:17 +00:00
parent d233fd1062
commit 5ffd0904b1
3 changed files with 13 additions and 9 deletions

View File

@@ -30,11 +30,12 @@
((when (= lastHeader "FILES") (Some line))
(rewardFiles.push
(let [parts (line.split " ")
piecesPerPoint (Std.parseInt (parts.pop))
puzzleHeight (Std.parseInt (parts.pop))
puzzleWidth (Std.parseInt (parts.pop))
startingPoints (Std.parseInt (parts.pop))
path (parts.join " ")]
(objectWith path startingPoints puzzleWidth puzzleHeight))))
(objectWith path startingPoints puzzleWidth puzzleHeight piecesPerPoint))))
((Some line)
(.push
(case lastHeader
@@ -140,7 +141,7 @@
"${label.label} $(* "|" label.points)") "/")")
(function :String stringifyRewardFile [:RewardFile rewardFile]
"${rewardFile.path} ${rewardFile.startingPoints} ${rewardFile.puzzleWidth} ${rewardFile.puzzleHeight}")
"${rewardFile.path} ${rewardFile.startingPoints} ${rewardFile.puzzleWidth} ${rewardFile.puzzleHeight} ${rewardFile.piecesPerPoint}")
(method :Void save []
(localVar &mut content "DAILY\n-----\n")
@@ -219,6 +220,6 @@
(objectWith [labels (for label labels (objectWith [points 0] label))] type))
(save))
(method addRewardFile [path startingPoints puzzleWidth puzzleHeight]
(rewardFiles.push (objectWith path startingPoints puzzleWidth puzzleHeight))
(method addRewardFile [path startingPoints puzzleWidth puzzleHeight piecesPerPoint]
(rewardFiles.push (objectWith path startingPoints puzzleWidth puzzleHeight piecesPerPoint))
(save))