summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-10-19 11:33:57 -0400
committerDavid Thompson <dthompson2@worcester.edu>2017-10-19 11:33:57 -0400
commita4df9bffb24b84322b139d1934991d3ce8e2c1f9 (patch)
tree29b416a085be748ec8cdbfdf72fd78b6164b1bd7
parent15b35e8fe0f26e00691db5c31a1ab9a9f4991bb2 (diff)
scripting: agenda: Add reset-agenda procedure.
* chickadee/scripting/agenda.scm (reset-agenda): New procedure.
-rw-r--r--chickadee/scripting/agenda.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/chickadee/scripting/agenda.scm b/chickadee/scripting/agenda.scm
index f16dc45..83cb4b7 100644
--- a/chickadee/scripting/agenda.scm
+++ b/chickadee/scripting/agenda.scm
@@ -26,6 +26,7 @@
agenda-time
update-agenda
clear-agenda
+ reset-agenda
schedule-at
schedule-after
schedule-every
@@ -83,6 +84,12 @@
"Remove all scheduled tasks from the current agenda."
(%agenda-clear! (current-agenda)))
+(define (reset-agenda)
+ "Remove all scheduled tasks from the current agenda and reset time
+to 0."
+ (%agenda-clear! (current-agenda))
+ (set-agenda-time! (current-agenda) 0))
+
(define (update-agenda dt)
"Advance the current agenda by DT."
(%update-agenda (current-agenda) dt))