 (defn tile-view [cursor owner]
   (reify
     om/IRenderState
-    (render-state [this {:keys [coords move] :as unit}]
-      (dom/td #js {:onClick #(put! move unit)}
+    (render-state [this {:keys [coords actions] :as unit}]
+      (dom/td #js {:onClick #(put! actions unit)}
         (if-let [ball (unit? :balls coords)]
           (dom/div #js {:className "ball"}))
         (if-let [red-player (unit? :red-team coords)]

  (Math/abs (- b a)))

(defn in-range? [target selected]
  (<=
   (reduce
    +
    (map distance (vals target) (vals selected)))
   move-range))


(defn turn-view [data owner]
  (reify

                           (flip-team app))
                         {:coords target}))
                      %)
                   units))))))
          (recur)))))

    om/IRenderState
    (render-state [this {:keys [actions]}]
      (dom/div #js {:className "container"}
        (om/build turn-view (:turn @app))
        (om/build action-view (:actions @app))
