first stateful interaction.
This commit is contained in:
@@ -125,3 +125,21 @@
|
||||
(run! dialogue/talking-screen :stop-talk :target-id target-id)
|
||||
(stop screen entities target-id))))
|
||||
(<!! c)))
|
||||
|
||||
(defn give [entities target-id item]
|
||||
(let [c (chan)]
|
||||
(put! (get-in entities [:actions :channel])
|
||||
(reify
|
||||
IAction
|
||||
(begin [this screen entities]
|
||||
(update-in entities [target-id :inventory] #(conj % item)))
|
||||
|
||||
(continue [this screen entities] entities)
|
||||
|
||||
(done? [this screen entities]
|
||||
true)
|
||||
|
||||
(terminate [this screen entities]
|
||||
(put! c entities)
|
||||
entities)))
|
||||
(<!! c)))
|
||||
|
||||
Reference in New Issue
Block a user