# HG changeset patch # User Robert McIntyre # Date 1332289034 18000 # Node ID bfd06de5a934ff690b47652bd532c386566808fe # Parent 76b031d2f586c0ca4713a71e15d29bb2d69746d3 made facilities for printing pokemon info. diff -r 76b031d2f586 -r bfd06de5a934 clojure/com/aurellem/exp/pokemon.clj --- a/clojure/com/aurellem/exp/pokemon.clj Tue Mar 20 18:50:49 2012 -0500 +++ b/clojure/com/aurellem/exp/pokemon.clj Tue Mar 20 19:17:14 2012 -0500 @@ -619,7 +619,25 @@ ([pokemon-num new-data] (set-pokemon-data @current-state pokemon-num new-data))) -(defn print-pokemon-data [^SaveState save pokemon-num]) +(defn print-pokemon-data + ([^SaveState state pokemon-num] + (assert (<= 0 pokemon-num 5)) + (let [poke-data (pokemon-data state pokemon-num) + backbone (sort (keys pokemon-1-info))] + (println "Pokemon " pokemon-num + "------------------------") + (dorun + (map + (comp println + (fn [desc data] + (format "%-16s : 0x%02X" desc data))) + + (map pokemon-1-info backbone) + poke-data)))) + ([pokemon-num] + (print-pokemon-data @current-state pokemon-num))) + -(defn pre-battle [] (read-state "prepare-for-battle")) \ No newline at end of file +(defn pre-battle [] (read-state "prepare-for-battle")) +