|
@@ -185,3 +185,10 @@
|
|
(let [{bombs :bombs} state
|
|
(let [{bombs :bombs} state
|
|
new-bombs (mapv #(update-in % [:counter] dec) bombs)]
|
|
new-bombs (mapv #(update-in % [:counter] dec) bombs)]
|
|
(assoc state :bombs new-bombs)))
|
|
(assoc state :bombs new-bombs)))
|
|
|
|
+
|
|
|
|
+(defn queue-action [state id action]
|
|
|
|
+ (update-in state [:players]
|
|
|
|
+ (partial
|
|
|
|
+ mapv-if
|
|
|
|
+ #(= id (:id %))
|
|
|
|
+ #(assoc % :action action))))
|