projects
/
mudsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
We can finally move around!
[mudsync.git]
/
mudsync
/
gameobj.scm
diff --git
a/mudsync/gameobj.scm
b/mudsync/gameobj.scm
index ba0d8291b3ddcbbfcf4871ec1616ade69e94d6d1..37f8bfefa8d07ebb85be81a9e17705089703f2b8 100644
(file)
--- a/
mudsync/gameobj.scm
+++ b/
mudsync/gameobj.scm
@@
-20,8
+20,10
@@
;;; ==========
(define-module (mudsync gameobj)
;;; ==========
(define-module (mudsync gameobj)
+ #:use-module (mudsync command)
#:use-module (8sync systems actors)
#:use-module (8sync agenda)
#:use-module (8sync systems actors)
#:use-module (8sync agenda)
+ #:use-module (srfi srfi-1)
#:use-module (oop goops)
#:export (<gameobj>
gameobj-simple-name-f
#:use-module (oop goops)
#:export (<gameobj>
gameobj-simple-name-f
@@
-101,11
+103,24
@@
(reply-message actor message
#:val (slot-ref actor slot))))
(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)
(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)
(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)
(define-mhandler (gameobj-add-occupant! actor message who)
(hash-set! (slot-ref actor 'occupants)
@@
-131,9
+146,9
@@
(set! (gameobj-loc actor) loc)
;; Change registation of where we currently are
(if loc
(set! (gameobj-loc actor) loc)
;; Change registation of where we currently are
(if loc
- (<- actor loc 'add-occupant! #:who (actor-id actor)))
+ (<-
wait
actor loc 'add-occupant! #:who (actor-id actor)))
(if old-loc
(if old-loc
- (<- actor old-loc 'remove-occupant! #:who (actor-id actor))))
+ (<-
wait
actor old-loc 'remove-occupant! #:who (actor-id actor))))
(define gameobj-get-name (simple-slot-getter 'name))
(define gameobj-get-desc (simple-slot-getter 'desc))
(define gameobj-get-name (simple-slot-getter 'name))
(define gameobj-get-desc (simple-slot-getter 'desc))