entity.clj

Branches > main > 7139e40 > files / src / net / bowmap / protocol / entity.clj

(ns net.bowmap.protocol.entity
  (:require
   [clojure.spec.alpha :as s]))

; A unique ephemeral ID for this entity, used in the protocol
(s/def ::id pos-int?)
(defonce highest-entity-id (ref 0))

(defn next-entity-id! []
  (dosync (commute highest-entity-id inc)))