 (defn found? [query cards]
   (some #(if (= (.toLowerCase (:title %)) query) %) cards))
 
-(defn influencelimit [identity]
+(defn id-inf-limit [identity]
   "Returns influence limit of an identity or INFINITY in case of draft IDs."
   (if (= (:setname identity) "Draft") INFINITY (:influencelimit identity)))
 


(defn noinfcost? [identity card]
  (or (= (:faction card) (:faction identity))
      (zero? (:factioncost card)) (= INFINITY (influencelimit identity))))

(defn search [query cards]
  (filter #(if (= (.indexOf (.toLowerCase (:title %)) query) -1) false true) cards))

        str (reduce #(str %1 (:qty %2) " " (get-in %2 [:card :title]) "\n") "" cards)]
    (om/set-state! owner :deck-edit str)))

(defn mostwanted
  "Returns a map of faction keywords to number of MWL restricted cards from the faction's cards."
  [deck]
  (let [cards (:cards deck)
        mwlhelper (fn [currmap line]
                    (let [card (:card line)]
                      (if (mostwanted? card)
                        (update-in currmap [(keyword (faction-label card))]
                                   (fnil (fn [curmwl] (+ curmwl (:qty line))) 0))
                        currmap)))]
    (reduce mwlhelper {} cards)))

(defn influence
  "Returns a map of faction keywords to influence values from the faction's cards."
  [deck]
  (let [identity (:identity deck)
        cards (:cards deck)
        infhelper (fn [currmap line]
