diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss index 7a738415..160b2093 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss @@ -107,8 +107,11 @@ points (count (l.split "") ->c (= c "|"))))))) (otherwise (break)))))) +(method :Array allEntries [] + (cast (concat dailyEntries monthlyEntries intervalEntries bonusEntries todoEntries))) + (method :Int totalPoints [] - (apply + (for l (flatten (for e (the Array (concat dailyEntries monthlyEntries intervalEntries bonusEntries todoEntries)) e.labels)) l.points))) + (apply + (for l (flatten (for e (allEntries) e.labels)) l.points))) (function :String stringify [:Entry e] "$(case e.type @@ -174,7 +177,7 @@ dayToEndSearch (if lastDayDone (DateTime.fromString lastDayDone) - (let [now (DateTime.fromDate (Date.now))] + (let [&mut now (DateTime.fromDate (Date.now))] (until (= 1 (now.getDay)) #|now -= oneDayInterval;|#) now))] (until (and (= (nextDay.getDay) (dayToEndSearch.getDay)) (= (nextDay.getMonth) (dayToEndSearch.getMonth)) (= (nextDay.getYear) (dayToEndSearch.getYear))) diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss index 74079455..5bc963e2 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss @@ -79,7 +79,7 @@ (map (m.activeTodoEntries) makeText) (add entryTexts) - (doFor e (the Array (concat m.dailyEntries m.monthlyEntries m.intervalEntries m.bonusEntries m.todoEntries)) + (doFor e (m.allEntries) (when (HabitModel.isActive e) (let [label (HabitModel.activeLabel e)] (shortcutHandler.registerItem label.label e))))