# HG changeset patch # User Steve Losh # Date 1311294362 14400 # Node ID 4eb927d5873483275f053bd77eb6b02001d732a6 # Parent ec310473df43b56886d489cc990c602c1df042fd Rearrange data declarations diff -r ec310473df43 -r 4eb927d58734 src/clojurecraft/data.clj --- a/src/clojurecraft/data.clj Thu Jul 21 20:24:43 2011 -0400 +++ b/src/clojurecraft/data.clj Thu Jul 21 20:26:02 2011 -0400 @@ -29,14 +29,6 @@ ; without modifying it). (defrecord Entity [eid loc despawned]) -; Chunk -; -; A single chunk in the world. -; -; blocks -> [block ...] -; A vector of the blocks in this chunk. -(defrecord Chunk [blocks]) - ; Block ; ; A representation of a single block. @@ -48,6 +40,30 @@ ; kind -> TODO (defrecord Block [loc kind]) +; Chunk +; +; A single chunk in the world. +; +; blocks -> [block ...] +; A vector of the blocks in this chunk. +(defrecord Chunk [blocks]) + +; World +; +; A representation of a single world/server, shared by all bots connected to it. +; +; server -> {:name hostname :port port} +; +; entities -> (ref {eid (ref Entity) ...}) +; A map of all the entities in the world. +; +; chunks -> (ref {[x y z] [(ref Chunk) ...] ...}) +; A map of all the chunks in the world. +; +; time -> (ref integer) +; The current world time. +(defrecord World [server entities chunks time]) + ; Bot ; ; A single bot, connected to a server. @@ -83,19 +99,3 @@ (defrecord Bot [connection outqueue player world packet-counts-in packet-counts-out]) -; World -; -; A representation of a single world/server, shared by all bots connected to it. -; -; server -> {:name hostname :port port} -; -; entities -> (ref {eid (ref Entity) ...}) -; A map of all the entities in the world. -; -; chunks -> (ref {[x y z] [(ref Chunk) ...] ...}) -; A map of all the chunks in the world. -; -; time -> (ref integer) -; The current world time. -(defrecord World [server entities chunks time]) -