X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fthing.scm;h=6963c01b985a2867f7fa89e89a12831ac50dfd70;hp=7b3a71d1538cc81c14693f3630ff88e866d22646;hb=701425bc611abaa8b4140942d995d5f32d24e2d7;hpb=6cff5b0062ef928204295ab4327bf2d417070421 diff --git a/mudsync/thing.scm b/mudsync/thing.scm index 7b3a71d..6963c01 100644 --- a/mudsync/thing.scm +++ b/mudsync/thing.scm @@ -21,7 +21,7 @@ (define-module (mudsync thing) #:use-module (mudsync command) #:use-module (mudsync gameobj) - #:use-module (8sync systems actors) + #:use-module (8sync actors) #:use-module (8sync agenda) #:use-module (oop goops) #:use-module (ice-9 match) @@ -30,9 +30,7 @@ thing-commands thing-commands* thing-contained-commands - thing-contained-commands* - thing-actions - thing-actions*)) + thing-contained-commands*)) (define thing-commands (list @@ -50,18 +48,6 @@ ;; so it's an alias. (define thing-contained-commands* thing-contained-commands) -(define thing-actions - (build-actions - (cmd-take (wrap-apply thing-cmd-take)) - (cmd-drop (wrap-apply thing-cmd-drop)))) - -(define thing-actions* - (append thing-actions - gameobj-actions)) - -(define thing-dispatcher - (simple-dispatcher thing-actions*)) - (define-class () ;; Can be a boolean or a procedure accepting two arguments ;; (thing-actor whos-acting) @@ -75,20 +61,18 @@ #:init-value (wrap thing-commands)) (contained-commands #:init-value (wrap thing-contained-commands)) - (message-handler - #:init-value - (wrap-apply thing-dispatcher))) + (actions #:allocation #:each-subclass + #:init-value + (build-actions + (cmd-take thing-cmd-take) + (cmd-drop thing-cmd-drop)))) (define* (thing-cmd-take thing message #:key direct-obj) (define player (message-from message)) (define player-name - (msg-receive (_ #:key val) - (<-wait thing player 'get-name) - val)) + (msg-val (<-wait thing player 'get-name))) (define player-loc - (msg-receive (_ #:key val) - (<-wait thing player 'get-loc) - val)) + (msg-val (<-wait thing player 'get-loc))) (define thing-name (slot-ref thing 'name)) (define should-take (slot-ref-maybe-runcheck thing 'takeable player)) @@ -111,13 +95,9 @@ (define* (thing-cmd-drop thing message #:key direct-obj) (define player (message-from message)) (define player-name - (msg-receive (_ #:key val) - (<-wait thing player 'get-name) - val)) + (msg-val (<-wait thing player 'get-name))) (define player-loc - (msg-receive (_ #:key val) - (<-wait thing player 'get-loc) - val)) + (msg-val (<-wait thing player 'get-loc))) (define thing-name (slot-ref thing 'name)) (define should-drop (slot-ref-maybe-runcheck thing 'dropable player))