projects
/
mudsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add commands and contain-commands to gameobj
[mudsync.git]
/
mudsync.scm
diff --git
a/mudsync.scm
b/mudsync.scm
index 05276a7987c186422a010d60f7ea6e9bfa9c4e85..8cc07b1389bb5fff85619774ace295b6b8aca8a3 100644
(file)
--- a/
mudsync.scm
+++ b/
mudsync.scm
@@
-377,13
+377,18
@@
with an anonymous persona"
;;; derive from this class.
;;; And all of them need a GM!
;;; derive from this class.
;;; And all of them need a GM!
-(define-class <game
-actor
> (<actor>)
+(define-class <game
obj
> (<actor>)
;; location id
(loc #:init-value #f
;; location id
(loc #:init-value #f
- #:accessor game
-actor
-loc)
+ #:accessor game
obj
-loc)
;; game master id
(gm #:init-keyword #:gm
;; game master id
(gm #:init-keyword #:gm
- #:getter game-actor-gm))
+ #:getter gameobj-gm)
+
+ ;; Commands we can handle
+ (commands #:init-value #f)
+ ;; Commands we can handle by being something's container
+ (contain-commands #:init-value #f))
\f
\f
@@
-430,7
+435,7
@@
with an anonymous persona"
#:val (slot-ref actor slot))))
#:val (slot-ref actor slot))))
-(define-class <room> (<game
-actor
>)
+(define-class <room> (<game
obj
>)
(name #:init-keyword #:name)
(desc #:init-value ""
#:init-keyword #:desc)
(name #:init-keyword #:name)
(desc #:init-value ""
#:init-keyword #:desc)
@@
-465,7
+470,7
@@
claim to point to."
(for-each
(lambda (exit)
(define new-exit
(for-each
(lambda (exit)
(define new-exit
- (<-wait room (game
-actor
-gm room) 'lookup-room
+ (<-wait room (game
obj
-gm room) 'lookup-room
#:symbol (exit-to-symbol exit)))
(set! (exit-to-address exit) new-exit))
#:symbol (exit-to-symbol exit)))
(set! (exit-to-address exit) new-exit))
@@
-477,7
+482,7
@@
claim to point to."
;;; Players
;;; =======
;;; Players
;;; =======
-(define-class <player> (<game
-actor
>)
+(define-class <player> (<game
obj
>)
(username #:init-keyword #:username
#:accessor player-username)
;; Connection id
(username #:init-keyword #:username
#:accessor player-username)
;; Connection id
@@
-494,7
+499,7
@@
claim to point to."
(define-mhandler (player-set-loc! player message id)
(format #t "DEBUG: Location set to ~s for player ~s\n"
id (actor-id-actor player))
(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! (game
-actor
-loc player) id))
+ (set! (game
obj
-loc player) id))
(define-mhandler (player-init! player message)
(player-look-around player))
(define-mhandler (player-init! player message)
(player-look-around player))
@@
-504,16
+509,16
@@
claim to point to."
(define (player-look-around player)
(define room-name
(message-ref
(define (player-look-around player)
(define room-name
(message-ref
- (<-wait player (game
-actor
-loc player) 'get-name)
+ (<-wait player (game
obj
-loc player) 'get-name)
'val))
(define room-desc
(message-ref
'val))
(define room-desc
(message-ref
- (<-wait player (game
-actor
-loc player) 'get-desc)
+ (<-wait player (game
obj
-loc player) 'get-desc)
'val))
(define message-text
(format #f "**~a**\n~a\n" room-name room-desc))
'val))
(define message-text
(format #f "**~a**\n~a\n" room-name room-desc))
- (<- player (game
-actor
-gm player) 'write-home #:text message-text))
+ (<- player (game
obj
-gm player) 'write-home #:text message-text))
\f
;;; Debugging stuff
\f
;;; Debugging stuff