bring back startingPoints in the habit save file

This commit is contained in:
2022-08-02 00:22:23 +00:00
parent 31afc7f912
commit 744f99bc46
2 changed files with 34 additions and 3 deletions

View File

@@ -27,9 +27,11 @@
(continue))
((Some "") (continue))
// Types won't unify with the next case, so this is its own:
((when (= lastHeader "FILES") (Some path))
((when (= lastHeader "FILES") (Some line))
(rewardFiles.push
(let [startingPoints (* rewardFiles.length HabitState.TOTAL_PIECES)]
(let [parts (line.split " ")
startingPoints (Std.parseInt (parts.pop))
path (parts.join " ")]
(objectWith path startingPoints))))
((Some line)
(.push
@@ -136,7 +138,7 @@
"${label.label} $(* "|" label.points)") "/")")
(function :String stringifyRewardFile [:RewardFile rewardFile]
rewardFile.path)
"${rewardFile.path} ${rewardFile.startingPoints}")
(method :Void save []
(localVar &mut content "DAILY\n-----\n")