Move all listeners into core so they can be made private

This commit is contained in:
oakes
2014-01-18 19:17:57 -05:00
parent 51547b9968
commit dca730c8fd
5 changed files with 187 additions and 180 deletions

View File

@@ -2,8 +2,8 @@
(:require [play-clj.math :as m]
[play-clj.utils :as u])
(:import [com.badlogic.gdx.physics.box2d Body BodyDef ChainShape CircleShape
Contact ContactListener EdgeShape Fixture FixtureDef JointDef
PolygonShape Transform World]))
Contact EdgeShape Fixture FixtureDef JointDef PolygonShape Transform
World]))
; world
@@ -193,17 +193,3 @@
(-> contact .getFixtureB .getBody)))
([screen entities]
(find-body (second-contact screen) entities)))
; listeners
(defn contact-listener
[{:keys [on-begin-contact on-end-contact on-post-solve on-pre-solve]} execute-fn!]
(reify ContactListener
(beginContact [this c]
(execute-fn! on-begin-contact :contact c))
(endContact [this c]
(execute-fn! on-end-contact :contact c))
(postSolve [this c i]
(execute-fn! on-post-solve :contact c :impulse i))
(preSolve [this c m]
(execute-fn! on-pre-solve :contact c :old-manifold m))))