                            #(if (= player-to-move %)
                                   (assoc % :x x :y y)
                                   %)
-                         cs)))))
-              (println (:cells app))))
+                         cs)))))))
             (recur)))))
     om/IRenderState
     (render-state [this {:keys [move]}]

                 (= (:y position) (:y %)))
               (:cells (om/root-cursor app-state)))))


(defn highlight-tile [e unit]
  (let [cursor (om/ref-cursor (:selected-unit (om/root-cursor app-state)))]
    (om/update! cursor unit))
    (set! (-> e .-target .-parentElement .-style .-border) "2px solid #f00"))

(defn update-piece-position [e state]
  (om/transact! (om/root-cursor app-state) :cells #(conj {:type :my-team :x 1 :y 8})))


(def board-size (range 0 9))
(def bench-size 4)

(defn border-top [y]
  (cond
