Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro init-gen
- [update-func]
- `(defn ~'-init
- []
- (dosync (ref-set update-ref ~update-func))))
- (defmacro make-game-class [update-func, name]
- `(do
- ~'(defn -state
- [this]
- @last-state)
- ~'(defn -startGame
- [this]
- (start-game))
- ~'(defn -getNextState
- [this]
- (get-next-state))
- (gen-class
- :name ~(symbol (str "forspareparts.clj_game.clojure_aot.games." name))
- :state ~'state
- :init ~(init-gen update-func)
- :methods [[~'startGame [] clojure.lang.IPersistentMap]
- [~'getNextState [] clojure.lang.IPersistentMap]])))
Advertisement
Add Comment
Please, Sign In to add comment