'("in" "inside" "on"))))))
;; Commands we can handle by being something's container
- (container-commands #:allocation #:each-subclass
- #:init-thunk (build-commands))
+ ;; dominant version (goes before everything)
+ (container-dom-commands #:allocation #:each-subclass
+ #:init-thunk (build-commands))
+ ;; subordinate version (goes after everything)
+ (container-sub-commands #:allocation #:each-subclass
+ #:init-thunk (build-commands))
;; Commands we can handle by being contained by something else
(contained-commands #:allocation #:each-subclass
;; Commands for co-occupants
(get-commands gameobj-get-commands)
;; Commands for participants in a room
- (get-container-commands gameobj-get-container-commands)
+ (get-container-dom-commands gameobj-get-container-dom-commands)
+ (get-container-sub-commands gameobj-get-container-sub-commands)
;; Commands for inventory items, etc (occupants of the gameobj commanding)
(get-contained-commands gameobj-get-contained-commands)
#:commands candidate-commands
#:goes-by (gameobj-goes-by actor)))
-(define* (gameobj-get-container-commands actor message #:key verb)
- "Get commands as the container / room of message's sender"
+(define* (gameobj-get-container-dom-commands actor message #:key verb)
+ "Get (dominant) commands as the container / room of message's sender"
(define candidate-commands
- (get-candidate-commands actor 'container-commands verb))
+ (get-candidate-commands actor 'container-dom-commands verb))
+ (<-reply message #:commands candidate-commands))
+
+(define* (gameobj-get-container-sub-commands actor message #:key verb)
+ "Get (subordinate) commands as the container / room of message's sender"
+ (define candidate-commands
+ (get-candidate-commands actor 'container-sub-commands verb))
(<-reply message #:commands candidate-commands))
(define* (gameobj-get-contained-commands actor message #:key verb)
#:player-id (actor-id player)))))
;; Ask the room for its commands
- (define room-commands
+ (define room-dom-commands
;; TODO: Map room id and sort
(mbody-receive (_ #:key commands)
- (<-wait player-loc 'get-container-commands
+ (<-wait player-loc 'get-container-dom-commands
+ #:verb verb)
+ commands))
+
+ (define room-sub-commands
+ ;; TODO: Map room id and sort
+ (mbody-receive (_ #:key commands)
+ (<-wait player-loc 'get-container-sub-commands
#:verb verb)
commands))
;; Now return a big ol sorted list of ((actor-id . command))
(append
- (sort-commands-append-actor room-commands
+ (sort-commands-append-actor room-dom-commands
player-loc '()) ; room doesn't go by anything
(sort-commands-multi-actors co-occupant-commands)
(sort-commands-append-actor our-commands
(actor-id player) '()) ; nor does player
- (sort-commands-multi-actors inv-item-commands)))
+ (sort-commands-multi-actors inv-item-commands)
+ (sort-commands-append-actor room-sub-commands
+ player-loc '())))
(define (sort-commands-append-actor commands actor-id goes-by)
(sort-commands-multi-actors