7da31a9
Branches > client-handling-rewrite > 7da31a9 > files
packet writer dofstring
Commit: 7da31a9a73c5e1525900bfcae361476ca0024994
Parent: d3f6d71
1 changed file:
src/net/bowmap/network/packet/write.clj view file
@@ -186,7 +186,10 @@ (writer buf x)))) ;; TODO what actually happens when the value is nil?-(defn enum-> [writer m]+(defn enum->+ "Writes an enum with writer 't', and a map 'm', which maps encoded values to values, so it is 'backwards'.+ For instance, the map {1 :foo} will write :foo as 1."+ [writer m] (let [m (set/map-invert m)] (fn [buf x] (writer buf (m x)))))@@ -197,6 +200,7 @@ (boolean-> buf x) (writer buf x)))) +; Want to conform the given map to the table, and error if any non-optional keys are missing? (defn table-> [t] (let [table (S/ensure-conform ::t/table t)] (fn [buf m]