;;; And all of them need a GM!
(define-class <game-actor> (<actor>)
+ ;; location id
+ (loc #:init-value #f
+ #:accessor game-actor-loc)
+ ;; game master id
(gm #:init-keyword #:gm
#:getter game-actor-gm))
(define-class <player> (<game-actor>)
(username #:init-keyword #:username
#:accessor player-username)
- ;; location id
- (loc #:init-value #f
- #:accessor player-loc)
;; Connection id
(client #:accessor player-client)
;;; player message handlers
(define-mhandler (player-set-loc! player message id)
- (format #t "DEBUG: Location set to ~s for player ~s"
+ (format #t "DEBUG: Location set to ~s for player ~s\n"
id (actor-id-actor player))
- (set! (player-loc player) id))
+ (set! (game-actor-loc player) id))
(define-mhandler (player-init! player message)
(player-look-around player))
(define (player-look-around player)
(define room-name
(message-ref
- (<-wait player (player-loc player) 'get-name)
+ (<-wait player (game-actor-loc player) 'get-name)
'val))
(define room-desc
(message-ref
- (<-wait player (player-loc player) 'get-desc)
+ (<-wait player (game-actor-loc player) 'get-desc)
'val))
(define message-text
(format #f "**~a**\n~a\n" room-name room-desc))