(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))
