X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=mudsync.scm;h=a15f5b9a02ea2a1f221129e2078832c9e18f3bde;hb=023ca5e3222fa0f53a30440c23e538b411af5195;hp=7219c37e947883daa75f9baa711b6395affc5394;hpb=f30bd11e2979247edc97671357d1f02d2fa72775;p=mudsync.git diff --git a/mudsync.scm b/mudsync.scm index 7219c37..a15f5b9 100644 --- a/mudsync.scm +++ b/mudsync.scm @@ -452,9 +452,11 @@ with an anonymous persona" #:val (slot-ref actor slot)))) +;; TODO: Subclass from container? (define-class () (desc #:init-value "" #:init-keyword #:desc) + ;; TODO: Switch this to be loc based ;; Uses a hash table like a set (values ignored) (occupants #:init-thunk make-hash-table) ;; A list of @@ -463,6 +465,9 @@ with an anonymous persona" ;; @@: Maybe eventually will inherit from some more general ;; game object class + (contain-commands + #:init-value %room-contain-commands) + (message-handler #:allocation #:each-subclass #:init-value @@ -480,6 +485,16 @@ with an anonymous persona" (hash-remove! (slot-ref actor 'occupants) who)) (wire-exits! (wrap-apply room-wire-exits!))))) +(define always (const #t)) + +(define %room-contain-commands + (list + (command "look" cmatch-just-verb always 'look-room) + (command "look" cmatch-direct-obj always 'look-member) + (command "go" cmathc-just-verb always 'go-where) + (command "go" cmatch-direct-obj always 'go-exit))) + + (define (room-wire-exits! room message) "Actually hook up the rooms' exit addresses to the rooms they claim to point to."