(define-module (mudsync room)
#:use-module (mudsync command)
#:use-module (mudsync gameobj)
- #:use-module (8sync systems actors)
+ #:use-module (8sync actors)
#:use-module (8sync agenda)
#:use-module (oop goops)
#:use-module (srfi srfi-1)
#:use-module (ice-9 control)
- #:export (<room>
- room-actions
- room-actions*
-
- <exit>))
+ #:export (<room> <exit>))
\f
;;; Exits
(greedy-command "say" 'cmd-say)
(greedy-command "emote" 'cmd-emote)))
-(define room-actions
- (build-actions
- (cmd-go (wrap-apply room-cmd-go))
- (cmd-go-where (wrap-apply room-cmd-go-where))
- (announce-entrance (wrap-apply room-announce-entrance))
- (look-room (wrap-apply room-look-room))
- (tell-room (wrap-apply room-act-tell-room))
- ;; in this case the command is the same version as the normal
- ;; look-room version
- (cmd-look-room (wrap-apply room-look-room))
- (cmd-look-at (wrap-apply room-look-at))
- (cmd-say (wrap-apply room-cmd-say))
- (cmd-emote (wrap-apply room-cmd-emote))))
-
-(define room-actions*
- (append room-actions gameobj-actions))
-
-(define room-action-dispatch
- (simple-dispatcher room-actions*))
-
;; TODO: Subclass from container?
(define-class <room> (<gameobj>)
;; A list of <exit>
(container-commands
#:init-value (wrap %room-contain-commands))
- (message-handler
- #:allocation #:each-subclass
- ;; @@: Can remove this indirection once things settle
- #:init-value (wrap-apply room-action-dispatch)))
+ (actions #:allocation #:each-subclass
+ #:init-value
+ (build-actions
+ (cmd-go room-cmd-go)
+ (cmd-go-where room-cmd-go-where)
+ (announce-entrance room-announce-entrance)
+ (look-room room-look-room)
+ (tell-room room-act-tell-room)
+ ;; in this case the command is the same version as the normal
+ ;; look-room version
+ (cmd-look-room room-look-room)
+ (cmd-look-at room-look-at)
+ (cmd-say room-cmd-say)
+ (cmd-emote room-cmd-emote))))
(define* (room-cmd-go room message #:key direct-obj)
(define exit