(ns sekai.core.gamestate)

(def empty-game-state
  {:canvas {:size {:height 512 :width 512}
            :canvas nil
            :world nil}
   :entities {}
   :tags {}
   :subscribers {}
   :settings {:loglevel 1
              :tile-size  16}
   :camera { :x 0 :y 0 :z 0 }
   :sprites {}
   :active true
   :tick 0
   })

(defonce game-state
  (atom empty-game-state))

(defn reset-game-state!
  ([] (reset! game-state empty-game-state))
  ([active] (reset-game-state!) (swap! game-state assoc :active active)))
