Changes
This commit is contained in:
8
src/cljs/sekai/event/queue.cljs
Normal file
8
src/cljs/sekai/event/queue.cljs
Normal file
@@ -0,0 +1,8 @@
|
||||
(ns sekai.event.queue
|
||||
(:require [sekai.core.gamestate :refer [game-state]]))
|
||||
|
||||
(defn next-tick []
|
||||
(-> @game-state :tick inc))
|
||||
|
||||
(defn enqueue! [event tick]
|
||||
(swap! game-state update-in [:queue (max tick (next-tick))] (fnil conj []) event))
|
Reference in New Issue
Block a user