Update mudsync code to use easier to use action inheritance system
[mudsync.git] / mudsync / player.scm
index 113770f72aa5d43ce23a34a87c95f4b8adfb5aa1..8bf75b2c0e9e59100ae2a8dd3dec465d7152674c 100644 (file)
 ;;; Players
 ;;; =======
 
-(define player-actions
-  (build-actions
-   (init (wrap-apply player-init))
-   (handle-input (wrap-apply player-handle-input))
-   (tell (wrap-apply player-tell))
-   (disconnect-self-destruct (wrap-apply player-disconnect-self-destruct))
-   (cmd-inventory (wrap-apply player-cmd-inventory))))
-
-(define player-actions*
-  (append player-actions
-          gameobj-actions))
-
-(define player-dispatcher
-  (simple-dispatcher player-actions*))
-
 (define player-self-commands
   (list
    (empty-command "inventory" 'cmd-inventory)
 
   (self-commands #:init-value player-self-commands)
 
-  (message-handler
-   #:init-value
-   (wrap-apply player-dispatcher)))
+  (actions #:allocation #:each-subclass
+           #:init-value
+           (mhandlers
+            (init player-init)
+            (handle-input player-handle-input)
+            (tell player-tell)
+            (disconnect-self-destruct player-disconnect-self-destruct)
+            (cmd-inventory player-cmd-inventory))))
 
 
 ;;; player message handlers