diff 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
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb_driver.clj	Mon Mar 12 00:31:10 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb_driver.clj	Mon Mar 12 09:59:26 2012 -0500
     1.3 @@ -99,6 +99,11 @@
     1.4  
     1.5  (defrecord Move [keys state])
     1.6  
     1.7 +(defn update-state []
     1.8 +  (reset! current-state
     1.9 +          (SaveState. (:frame @current-state)
    1.10 +                      (Gb/saveState))))
    1.11 +
    1.12  (defn step
    1.13    ([^SaveState state buttons]
    1.14       (set-state! state)