diff clojure/com/aurellem/gb/types.clj @ 190:9a7a46c4aa1b

extending functionality of support namespaces in prepreation of give-pokemon
author Robert McIntyre <rlm@mit.edu>
date Thu, 22 Mar 2012 16:34:10 -0500
parents 4f5ea93cbaca
children 85a2c2e2d318
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/types.clj	Thu Mar 22 15:58:39 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/types.clj	Thu Mar 22 16:34:10 2012 -0500
     1.3 @@ -23,10 +23,10 @@
     1.4    (zipmap (vals type-code->type-name)
     1.5            (keys type-code->type-name)))
     1.6  
     1.7 -(def pokemon-1-types-start-address 0xD16F)
     1.8 +(def pokemon-1-type-start-address 0xD16F)
     1.9  
    1.10  (defn pokemon-type-start-address [poke-num]
    1.11 -  (+ pokemon-1-types-start-address
    1.12 +  (+ pokemon-1-type-start-address
    1.13       (* pokemon-record-width poke-num)))
    1.14  
    1.15  (defn give-type
    1.16 @@ -43,7 +43,7 @@
    1.17    ([poke-num types]
    1.18       (give-type @current-state poke-num types)))
    1.19  
    1.20 -(defn read-types
    1.21 +(defn read-type
    1.22    ([^SaveState state poke-num]
    1.23       (assert (<= 0 poke-num 5))
    1.24       (let [types-start (pokemon-type-start-address poke-num)
    1.25 @@ -54,5 +54,5 @@
    1.26           [(type-code->type-name type-1)]
    1.27           (mapv type-code->type-name [type-1 type-2]))))
    1.28    ([poke-num]
    1.29 -     (read-types @current-state poke-num)))
    1.30 +     (read-type @current-state poke-num)))
    1.31                     
    1.32 \ No newline at end of file