 (ns client.game.history
   )
+
+(def prev-columns nil)
 
 (def size 5)
 


(defn draw-history!
  [history]
  (doseq [[i s] (map-indexed vector history)]
    (draw-state! i s)))

(def canvas nil)
(def ctx nil)

(defn resize-canvas!
  [columns]
  (aset canvas "height" (* 22 size))
  (aset canvas "width" (* columns size))
  )

(defn init-canvas!
  [id]
  (set! canvas (.getElementById js/document id))
  (set! ctx (.getContext canvas "2d"))
  )

(defn draw-state!
  [i s]

  (js/console.log i (:drop-y s) (:height s) (pr-str (:collapsed s)))
  (aset ctx "fillStyle" back-color)
  (.fillRect ctx i 0 1 22)
