X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=mudsync%2Fplayer.scm;h=feb14f80a2375e9b67a4d6b4728ab558226c0c12;hb=a91cab366a655c3162fb516b7b1242d60f0e2d2a;hp=fece716dbe415d45f0073dedb8e6cfa70eeaa384;hpb=136ce3b725c83af0b7e8be632e943de6b07b65c5;p=mudsync.git diff --git a/mudsync/player.scm b/mudsync/player.scm index fece716..feb14f8 100644 --- a/mudsync/player.scm +++ b/mudsync/player.scm @@ -32,6 +32,15 @@ ;;; Players ;;; ======= +(define player-actions + (build-actions + (init (wrap-apply player-init!)) + (handle-input (wrap-apply player-handle-input)))) + +(define player-actions* + (append player-actions + gameobj-actions)) + (define-class () (username #:init-keyword #:username #:accessor player-username) @@ -45,17 +54,10 @@ (message-handler #:init-value ;; @@: We're gonna need action inheritance real awful soon, huh? - (make-action-dispatch - (set-loc! (wrap-apply player-set-loc!)) - (init (wrap-apply player-init!)) - (handle-input (wrap-apply player-handle-input))))) + (simple-dispatcher player-actions*))) -;;; player message handlers -(define-mhandler (player-set-loc! player message id) - (format #t "DEBUG: Location set to ~s for player ~s\n" - id (actor-id-actor player)) - (set! (gameobj-loc player) id)) +;;; player message handlers (define-mhandler (player-init! player message) (player-look-around player))