little cleanups

This commit is contained in:
Jeremy Penner 2013-05-08 20:35:53 -04:00
parent c60013f21f
commit ecc4fa4b7e
3 changed files with 8 additions and 10 deletions

View file

@ -49,7 +49,7 @@
:drag (gs/update-entity :drag (gs/update-entity
(update-in entity [:blobs blobid] (update-in entity [:blobs blobid]
#(into % (blob/screen-pos-to-blob (:mousex input) (:mousey input) entity)))) #(into % (blob/screen-pos-to-blob (:mousex input) (:mousey input) entity))))
(println event))) nil))
(defn- update-blobs [inputs] (defn- update-blobs [inputs]
(doseq [input inputs] (doseq [input inputs]
@ -67,9 +67,7 @@
(doseq [blob (vals (:blobs blobs))] (doseq [blob (vals (:blobs blobs))]
(let [{:keys [x y]} (let [{:keys [x y]}
(blob/blob-pos-to-screen blob blobs)] (blob/blob-pos-to-screen blob blobs)]
;(println x y) (.fill g (org.newdawn.slick.geom.Circle. x y 10))))))
(.fill g (org.newdawn.slick.geom.Circle. x y 5)))
)))
(defn update-gs-at [ts inputs] (defn update-gs-at [ts inputs]
(do (do

View file

@ -78,8 +78,8 @@
(defn assoc-in-entity [id keys value] (defn assoc-in-entity [id keys value]
(set-entity id (assoc-in (entity id) keys value))) (set-entity id (assoc-in (entity id) keys value)))
(defn update-in-entity [id keys fn] (defn update-in-entity [id keys fn & args]
(set-entity id (update-in (entity id) keys fn))) (set-entity id (apply update-in (entity id) keys fn args)))
(defn remove-entity [value] (defn remove-entity [value]
(set-entity (::id value) nil)) (set-entity (::id value) nil))

View file

@ -16,11 +16,11 @@
(let [executor (reify java.util.concurrent.Executor (let [executor (reify java.util.concurrent.Executor
(execute [this f] (swap! (:evalqueue repl) #(conj % f)))) (execute [this f] (swap! (:evalqueue repl) #(conj % f))))
server (server/start-server server (server/start-server
:port (:port repl) :port (:port repl)
:handler :handler
(-> server/unknown-op (-> server/unknown-op
clojure.tools.nrepl.middleware/wrap-describe clojure.tools.nrepl.middleware/wrap-describe
(hottub.interruptible-eval/interruptible-eval (hottub.interruptible-eval/interruptible-eval
:executor executor :executor executor
:eval-wrapper eval-wrapper) :eval-wrapper eval-wrapper)
clojure.tools.nrepl.middleware.load-file/wrap-load-file clojure.tools.nrepl.middleware.load-file/wrap-load-file
@ -36,9 +36,9 @@
(reset! (:server repl) nil)) (reset! (:server repl) nil))
(defn repl-update [repl] (defn repl-update [repl]
(doseq [f (reset-returning-old! (:evalqueue repl) [])] (doseq [f (reset-returning-old! (:evalqueue repl) [])]
(try (try
(f) (f)
(catch Exception e (catch Exception e
(println "couldn't eval:") (println "couldn't eval:")
(.printStackTrace e))))) (.printStackTrace e)))))