4fbba8a

Bowmap · bowmap.git · Tickets

Branches > main > 4fbba8a > files

Update entity id docstring and add spec

Grahp, 2026-10-09

Commit: 4fbba8a7bd15cb69bc00d7e59835a2e861277df5
Parent: 925e7cd

1 changed file:

src/net/bowmap/server/packet/entity.clj modified (view file)

@@ -1,9 +1,13 @@-(ns net.bowmap.server.packet.entity)+(ns net.bowmap.server.packet.entity+  (:require+   [clojure.spec.alpha :as s]))++(s/def ::id pos-int?)  (defonce highest-entity-id (atom 0))  (defn next-entity-id-  "Returns the next highest available entity ID.-   Entity IDs are unique used in the protocol to refer to entities."+  "Returns a new entity ID, unique for the lifetime of the server.+   Most packets refer to entities by their ID rather than their UUID."   []   (swap! highest-entity-id inc))