projects
/
mudsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rearchitect so that the world can init with a game-spec, not just a room-spec
[mudsync.git]
/
mudsync
/
gameobj.scm
diff --git
a/mudsync/gameobj.scm
b/mudsync/gameobj.scm
index 921850eef534cde51c23a18a1d9be3a7d91d493c..a418cf0c1566b38622dd61d74264f389605c5458 100644
(file)
--- a/
mudsync/gameobj.scm
+++ b/
mudsync/gameobj.scm
@@
-43,6
+43,7
@@
;;; Actions supported by all gameobj
(define gameobj-actions
(build-actions
;;; 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))
(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))
(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.
;;; *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))))
(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)
(define (val-or-run val-or-proc)
"Evaluate if a procedure, or just return otherwise"
(if (procedure? val-or-proc)