changeset 189:d954835b24a4

renamed *pokemon-data* to *pokemon-record*
author Robert McIntyre <rlm@mit.edu>
date Thu, 22 Mar 2012 15:58:39 -0500
parents 4e3d5f338750
children 9a7a46c4aa1b
files clojure/com/aurellem/gb/pokemon.clj
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/pokemon.clj	Thu Mar 22 07:38:00 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/pokemon.clj	Thu Mar 22 15:58:39 2012 -0500
     1.3 @@ -90,7 +90,7 @@
     1.4  
     1.5  (def unknown "")
     1.6  
     1.7 -(def pokemon-1-info
     1.8 +(def pokemon-1-record
     1.9    {0xD16A "Color Map"            ;; 0
    1.10     0xD16B "Current-HP (h)"       ;; 1
    1.11     0xD16C "Current-HP (l)"       ;; 2
    1.12 @@ -137,27 +137,27 @@
    1.13     0xD195 "Special  (l)"         ;; 43
    1.14     })
    1.15  
    1.16 -(defn pokemon-data
    1.17 +(defn pokemon-record
    1.18    ([^SaveState state pokemon-num]
    1.19       (assert (<= 0 pokemon-num 5))
    1.20       (let [base (+ (* pokemon-num  pokemon-record-width) 0xD16A)]
    1.21         (subvec (vec (memory state)) base
    1.22                 (+ base pokemon-record-width))))
    1.23 -  ([pokemon-num] (pokemon-data @current-state pokemon-num)))
    1.24 +  ([pokemon-num] (pokemon-record @current-state pokemon-num)))
    1.25  
    1.26 -(defn set-pokemon-data
    1.27 +(defn set-pokemon-record
    1.28    ([^SaveState state pokemon-num new-data]
    1.29       (assert (<= 0 pokemon-num 5))
    1.30       (let [base (+ (* pokemon-num  pokemon-record-width) 0xD16A)]
    1.31         (set-memory-range state base new-data)))
    1.32    ([pokemon-num new-data]
    1.33 -     (set-pokemon-data @current-state pokemon-num new-data)))
    1.34 +     (set-pokemon-record @current-state pokemon-num new-data)))
    1.35  
    1.36 -(defn print-pokemon-data
    1.37 +(defn print-pokemon-record
    1.38    ([^SaveState state pokemon-num]
    1.39       (assert (<= 0 pokemon-num 5))
    1.40 -     (let [poke-data (pokemon-data state pokemon-num)
    1.41 -           backbone (sort (keys pokemon-1-info))]
    1.42 +     (let [poke-data (pokemon-record state pokemon-num)
    1.43 +           backbone (sort (keys pokemon-1-record))]
    1.44         (println "Pokemon " pokemon-num  " -- "
    1.45                  (nth (party-names state)
    1.46                       pokemon-num) \newline)
    1.47 @@ -175,7 +175,7 @@
    1.48                              str 
    1.49                              (concat (repeat (- 8 (count s)) "0" )
    1.50                                      s))))))
    1.51 -         (map pokemon-1-info backbone)
    1.52 +         (map pokemon-1-record backbone)
    1.53           poke-data))))
    1.54    ([pokemon-num]
    1.55 -     (print-pokemon-data @current-state pokemon-num)))
    1.56 +     (print-pokemon-record @current-state pokemon-num)))