 (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 valid? [{:keys [identity cards] :as deck}]
  (and (>= (card-count cards) (:minimumdecksize identity))
       (<= (influence-count deck) (influencelimit identity))
       (every? #(and (allowed? (:card %) identity)
                     (<= (:qty %) (or (get-in % [:card :limited]) 3))) cards)
       (or (= (:side identity) "Runner")


(defn noinfcost? [identity card]
  (or (= (:faction card) (:faction identity))
      (zero? (:factioncost card)) (= INFINITY (id-inf-limit identity))))

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