 ;; type definitions
 
 ;; unit type kw lookup is a special case to add in the minerals and geysers
-(def unit-type-kw-lookup
+(def unit-type-kws
   (merge {:mineral jnibwapi.types.UnitType$UnitTypes/Resource_Mineral_Field
           :geyser jnibwapi.types.UnitType$UnitTypes/Resource_Vespene_Geyser}
          (zipmap (map keyword (take-nth 2 unit-types))

(defn build
  ([builder point to-build] (build builder (.x point) (.y point) to-build))
  ([builder tile-x tile-y to-build] (.build api (.getID builder) tile-x tile-y
                                            (.getID (to-build unit-type-kw-lookup)))))

(defn build-addon [building to-build]
  (.buildAddon api (.getID building) (.getID (to-build unit-type-kw-lookup))))

(defn train [building to-train]
  (.train api (.getID building) (.getID (to-train unit-type-kw-lookup))))

(defn morph [unit morph-to]
  (.morph api (.getID unit) (.getID (morph-to unit-type-kw-lookup))))

(defn research [unit to-research]
  (.research api (.getID unit) (.getID (to-research tech-type-kw-lookup))))

(defn upgrade [unit to-upgrade]
  (.upgrade api (.getID unit) (.getID (to-upgrade upgrade-type-kw-lookup))))

(defn set-rally-point
  ([rally-unit target-unit-or-point]

(gen-type-ids-map explosion-type-ids 'jnibwapi.types.ExplosionType$ExplosionTypes explosion-types)
(gen-type-ids-map order-type-ids 'jnibwapi.types.OrderType$OrderTypes order-types)

(gen-type-kw-map upgrade-type-kws 'jnibwapi.types.UpgradeType$UpgradeTypes upgrade-types)
(gen-type-kw-map tech-type-kws 'jnibwapi.types.TechType$TechTypes tech-types)
(gen-type-kw-map unit-command-type-kws 'jnibwapi.types.UnitCommandType$UnitCommandTypes unit-command-types)
(gen-type-kw-map race-type-kws 'jnibwapi.types.RaceType$RaceTypes race-types)
(gen-type-kw-map unit-size-type-kws 'jnibwapi.types.UnitSizeType$UnitSizeTypes unit-size-types)
(gen-type-kw-map weapon-type-kws 'jnibwapi.types.WeaponType$WeaponTypes weapon-types)
(gen-type-kw-map bullet-type-kws 'jnibwapi.types.BulletType$BulletTypes bullet-types)
(gen-type-kw-map damage-type-kws 'jnibwapi.types.DamageType$DamageTypes damage-types)
(gen-type-kw-map explosion-type-kws 'jnibwapi.types.ExplosionType$ExplosionTypes explosion-types)
(gen-type-kw-map order-type-kws 'jnibwapi.types.OrderType$OrderTypes order-types)

;; common calls to get state vars and collections

