             [iyye.bios.resource :as resource]
             [iyye.bios.persistence :as persistence]
             [iyye.bios.noun-words :as nouns]
+            [iyye.bios.task :as task]
             [clojure.tools.logging :as log]
             [clojure.tools.cli :refer [parse-opts]]
             [clojure.string :as str]))


; wake sleep state machine
(defn main-loop []
  (nouns/add-word "iyye.days" #(list @resource/num-days) nil)
  (while true
    (let [current-day (resource/create-day)]
      (resource/start-day current-day)


        (while (not (resource/is-night-over? current-night))
          (Thread/sleep DAY_CHECK_TIME_MILLIS))

        (resource/stop-night current-night))))

(def main-task {:name "iyye.bios.main" :function main-loop :task-future (ref 0) :parent nil :children (ref (list))})

(defn- load-state [name]
  (log/info "first day load")
