X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=mudsync%2Fgameobj.scm;h=a418cf0c1566b38622dd61d74264f389605c5458;hb=7525c62ccdf9e3480214831fb14d9a2d30ab139d;hp=921850eef534cde51c23a18a1d9be3a7d91d493c;hpb=4ea75c3db75e83c8133e2833d0ad7820aacc30b7;p=mudsync.git diff --git a/mudsync/gameobj.scm b/mudsync/gameobj.scm index 921850e..a418cf0 100644 --- a/mudsync/gameobj.scm +++ b/mudsync/gameobj.scm @@ -43,6 +43,7 @@ ;;; Actions supported by all gameobj (define gameobj-actions (build-actions + (init (wrap-apply gameobj-init)) (get-commands (wrap-apply gameobj-get-commands)) (get-container-commands (wrap-apply gameobj-get-container-commands)) (get-occupants (wrap-apply gameobj-get-occupants)) @@ -50,8 +51,7 @@ (remove-occupant! (wrap-apply gameobj-remove-occupant!)) (set-loc! (wrap-apply gameobj-set-loc!)) (get-name (wrap-apply gameobj-get-name)) - (get-desc (wrap-apply gameobj-get-desc)) - )) + (get-desc (wrap-apply gameobj-get-desc)))) ;;; *all* game components that talk to players should somehow ;;; derive from this class. @@ -104,6 +104,13 @@ (reply-message actor message #:val (slot-ref actor slot)))) + +;; @@: This could be kind of a messy way of doing gameobj-init +;; stuff. If only we had generic methods :( +(define-mhandler (gameobj-init actor message) + "Your most basic game object init procedure. Does nothing." + #f) + (define (val-or-run val-or-proc) "Evaluate if a procedure, or just return otherwise" (if (procedure? val-or-proc)