 (defn start-night [night]
   (doall
     [(start-task night)
+     (persistence/record-night @num-days)
      (dosync ref-set (:night-start night) (System/currentTimeMillis))]))
 
 (defn stop-day [day]

(ns iyye.resource
  (:require
    [iyye.task :refer [start-task stop-task]]
    [clojure.tools.logging :as log]))

(defprotocol Resource

    [(start-task day)
     (dosync ref-set (:day-start day) (System/currentTimeMillis))
     (dosync ref-set awake-or-sleep true)
     (dosync (alter num-days inc))
     (persistence/record-day @num-days)
     (log/info "next day: " @num-days)]))

(defn is-day-over? [day] (are-resources-exhausted? day))

