+(define-mhandler (gameobj-get-commands actor message verb)
+ "Get commands a co-occupant of the room might execute for VERB"
+ (define filtered-commands
+ (filter-commands (val-or-run (slot-ref actor 'commands))
+ verb))
+ (<-reply actor message
+ #:commands filtered-commands
+ #:goes-by (gameobj-goes-by actor)))
+
+(define-mhandler (gameobj-get-container-commands actor message verb)
+ "Get commands as the container / room of message's sender"
+ (define filtered-commands
+ (filter-commands (val-or-run (slot-ref actor 'container-commands))
+ verb))
+ (<-reply actor message #:commands filtered-commands))
+
+(define-mhandler (gameobj-add-occupant! actor message who)
+ "Add an actor to our list of present occupants"
+ (hash-set! (slot-ref actor 'occupants)
+ who #t))
+
+(define-mhandler (gameobj-remove-occupant! actor message who)
+ "Remove an occupant from the room."
+ (hash-remove! (slot-ref actor 'occupants) who))
+
+(define* (gameobj-occupants gameobj #:key exclude)
+ (hash-fold
+ (lambda (occupant _ prev)
+ (define exclude-it?
+ (match exclude
+ ;; Empty list and #f are non-exclusion
+ (() #f)
+ (#f #f)
+ ;; A list of addresses... since our address object is (annoyingly)
+ ;; currently a simple cons cell...
+ ((exclude-1 ... exclude-rest)
+ (pk 'failboat (member occupant (pk 'exclude-lst exclude))))
+ ;; Must be an individual address!
+ (_ (equal? occupant exclude))))
+ (if exclude-it?
+ prev
+ (cons occupant prev)))
+ '()
+ (slot-ref gameobj 'occupants)))
+
+(define-mhandler (gameobj-get-occupants actor message)
+ "Get all present occupants of the room."
+ (define exclude (message-ref message 'exclude #f))
+ (define occupants
+ (gameobj-occupants actor #:exclude exclude))
+
+ (<-reply actor message
+ #:occupants occupants))
+
+(define (gameobj-set-loc! gameobj loc)
+ "Set the location of this object."
+ (define old-loc (gameobj-loc gameobj))
+ (format #t "DEBUG: Location set to ~s for ~s\n"
+ loc (actor-id-actor gameobj))
+
+ (slot-set! gameobj 'loc loc)
+ ;; Change registation of where we currently are
+ (if loc
+ (<-wait gameobj loc 'add-occupant! #:who (actor-id gameobj)))
+ (if old-loc
+ (<-wait gameobj old-loc 'remove-occupant! #:who (actor-id gameobj))))
+
+;; @@: Should it really be #:id ? Maybe #:loc-id or #:loc?
+(define-mhandler (gameobj-act-set-loc! actor message loc)
+ "Action routine to set the location."
+ (gameobj-set-loc! actor loc))
+
+(define gameobj-get-name (simple-slot-getter 'name))
+
+(define-mhandler (gameobj-get-desc actor message whos-looking)
+ (define desc-text
+ (match (slot-ref actor 'desc)
+ ((? procedure? desc-proc)
+ (desc-proc actor whos-looking))
+ (desc desc)))
+ (<-reply actor message #:val desc-text))