;;; ==========
(define-module (mudsync gameobj)
+ #:use-module (mudsync command)
#:use-module (8sync systems actors)
#:use-module (8sync agenda)
+ #:use-module (srfi srfi-1)
#:use-module (oop goops)
#:export (<gameobj>
gameobj-simple-name-f
(reply-message actor message
#:val (slot-ref actor slot))))
+(define (filter-commands commands verb)
+ (filter
+ (lambda (cmd)
+ (equal? (command-verbs cmd)
+ verb))
+ commands))
+
(define-mhandler (gameobj-get-commands actor message verb)
- (<-reply actor message #:commands (slot-ref actor 'commands)))
+ (define filtered-commands
+ (filter-commands (slot-ref actor 'commands)
+ verb))
+ (<-reply actor message #:commands filtered-commands))
(define-mhandler (gameobj-get-container-commands actor message verb)
- (<-reply actor message #:commands (slot-ref actor 'container-commands)))
+ (define filtered-commands
+ (filter-commands (slot-ref actor 'container-commands)
+ verb))
+ (<-reply actor message #:commands filtered-commands))
(define-mhandler (gameobj-add-occupant! actor message who)
(hash-set! (slot-ref actor 'occupants)