changeset 167:bfd06de5a934

made facilities for printing pokemon info.
author Robert McIntyre <rlm@mit.edu>
date Tue, 20 Mar 2012 19:17:14 -0500
parents 76b031d2f586
children 04dfda91db9c
files clojure/com/aurellem/exp/pokemon.clj
diffstat 1 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/pokemon.clj	Tue Mar 20 18:50:49 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/pokemon.clj	Tue Mar 20 19:17:14 2012 -0500
     1.3 @@ -619,7 +619,25 @@
     1.4    ([pokemon-num new-data]
     1.5       (set-pokemon-data @current-state pokemon-num new-data)))
     1.6  
     1.7 -(defn print-pokemon-data [^SaveState save pokemon-num])
     1.8 +(defn print-pokemon-data
     1.9 +  ([^SaveState state pokemon-num]
    1.10 +     (assert (<= 0 pokemon-num 5))
    1.11 +     (let [poke-data (pokemon-data state pokemon-num)
    1.12 +           backbone (sort (keys pokemon-1-info))]
    1.13 +       (println "Pokemon " pokemon-num
    1.14 +                "------------------------")
    1.15 +       (dorun
    1.16 +        (map
    1.17 +         (comp println
    1.18 +               (fn [desc data]
    1.19 +                 (format "%-16s  :  0x%02X" desc data)))
    1.20 +         
    1.21 +         (map pokemon-1-info backbone)
    1.22 +         poke-data))))
    1.23 +  ([pokemon-num]
    1.24 +     (print-pokemon-data @current-state pokemon-num)))
    1.25 +        
    1.26  
    1.27  
    1.28 -(defn pre-battle [] (read-state "prepare-for-battle"))
    1.29 \ No newline at end of file
    1.30 +(defn pre-battle [] (read-state "prepare-for-battle"))
    1.31 +