comparison clojure/com/aurellem/gb_driver.clj @ 99:9fad96094950

can now read and set the inventory of a state
author Robert McIntyre <rlm@mit.edu>
date Mon, 12 Mar 2012 09:59:26 -0500
parents cb487c4ce5c0
children 2090bcb78f44
comparison
equal deleted inserted replaced
98:08cd8be1edc1 99:9fad96094950
97 (Gb/loadState (:data state))) 97 (Gb/loadState (:data state)))
98 (reset! current-state state)) 98 (reset! current-state state))
99 99
100 (defrecord Move [keys state]) 100 (defrecord Move [keys state])
101 101
102 (defn update-state []
103 (reset! current-state
104 (SaveState. (:frame @current-state)
105 (Gb/saveState))))
106
102 (defn step 107 (defn step
103 ([^SaveState state buttons] 108 ([^SaveState state buttons]
104 (set-state! state) 109 (set-state! state)
105 (Gb/step (button-mask buttons)) 110 (Gb/step (button-mask buttons))
106 (reset! current-state 111 (reset! current-state