Autosaving

This commit is contained in:
2014-11-22 13:57:05 -08:00
parent 54b1f1497a
commit 919871ddc3
11 changed files with 100 additions and 60 deletions

View File

@@ -25,7 +25,9 @@
(get-channel [this]))
(defn has-item? [entities item]
((set (get-in entities [:state :inventory])) item))
(if (map? entities)
((set (get-in entities [:state :inventory])) item)
((set (get-in @entities [:state :inventory])) item)))
(defn has-one-of? [entities items]
(seq (set/intersection (set (get-in entities [:state :inventory])) (set items))))
@@ -339,7 +341,7 @@
(-> entities
(update-in [:state :inventory] #(conj % item))
(assoc-in [:cursor :current] (:cursor item))))
(assoc-in [:cursor :current] ((:all-items entities) item))))
(continue [this screen entities] entities)