001 (ns the-great-game.objects.game-object
002 "Anything at all in the game world")
003
004 (defprotocol ProtoObject
005 "An object in the world"
006 (id [object] "Returns the unique id of this object.")
007 (reify-object
008 [object]
009 "Adds this `object` to the global object list. If the `object` has a
010 non-nil value for its `id` method, keys it to that id - **but** if the
011 id value is already in use, throws a hard exception. Returns the id to
012 which the object is keyed in the global object list."))
013
014 (defrecord GameObject
015 [id]
016 ;; "An object in the world"
017 ProtoObject
018 (id [_] id)
019 (reify-object [object] "TODO: doesn't work yet"))