From: Christopher Allan Webber Date: Thu, 5 May 2016 03:20:48 +0000 (-0500) Subject: Remove all accessors X-Git-Tag: fosdem-2017~180 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=7248fd4470039dab59a8e3a95829952e91c0fd19;p=mudsync.git Remove all accessors --- diff --git a/mudsync/game-master.scm b/mudsync/game-master.scm index 0d2051e..aab0b7a 100644 --- a/mudsync/game-master.scm +++ b/mudsync/game-master.scm @@ -41,11 +41,11 @@ #:getter gm-reverse-client-dir) ;; Network manager - (network-manager #:accessor gm-network-manager + (network-manager #:getter gm-network-manager #:init-value #f) ;; How we get a new connection acclimated to the system - (new-conn-handler #:accessor gm-new-conn-handler + (new-conn-handler #:getter gm-new-conn-handler #:init-keyword #:new-conn-handler) (message-handler @@ -114,8 +114,8 @@ (define (gm-setup-network gm) ;; Create a default network manager if none available - (set! (gm-network-manager gm) - (create-actor* gm "netman" + (slot-set! gm 'network-manager + (create-actor* gm "netman" #:send-input-to (actor-id gm))) ;; TODO: Add host and port options diff --git a/mudsync/gameobj.scm b/mudsync/gameobj.scm index bb4c852..7be0865 100644 --- a/mudsync/gameobj.scm +++ b/mudsync/gameobj.scm @@ -61,11 +61,11 @@ (define-class () ;; location id (loc #:init-value #f - #:accessor gameobj-loc) + #:getter gameobj-loc) ;; Uses a hash table like a set (values ignored) (occupants #:init-thunk make-hash-table - #:accessor gameobj-occupants) + #:getter gameobj-occupants) ;; game master id (gm #:init-keyword #:gm @@ -167,7 +167,7 @@ (format #t "DEBUG: Location set to ~s for ~s\n" loc (actor-id-actor actor)) - (set! (gameobj-loc actor) loc) + (slot-set! actor 'loc loc) ;; Change registation of where we currently are (if loc (<-wait actor loc 'add-occupant! #:who (actor-id actor))) diff --git a/mudsync/networking.scm b/mudsync/networking.scm index 76758c1..fe641cc 100644 --- a/mudsync/networking.scm +++ b/mudsync/networking.scm @@ -19,9 +19,9 @@ (define %default-port 8889) (define-class () - (server-socket #:accessor nm-server-socket) + (server-socket #:getter nm-server-socket) ;; mapping of client -> client-id - (clients #:accessor nm-clients + (clients #:getter nm-clients #:init-thunk make-hash-table) ;; send input to this actor (send-input-to #:getter nm-send-input-to @@ -87,7 +87,7 @@ ;; (sigaction SIGPIPE SIG_IGN) ;; Will this break other things that use pipes for us though? - (set! (nm-server-socket nm) s) + (slot-set! nm 'server-socket s) (format #t "Listening for clients in pid: ~s\n" (getpid)) (8sync-port s #:read (lambda (s) (nm-new-client nm s))) diff --git a/mudsync/player.scm b/mudsync/player.scm index 00b28ed..3fb0136 100644 --- a/mudsync/player.scm +++ b/mudsync/player.scm @@ -50,13 +50,11 @@ (define-class () (username #:init-keyword #:username - #:accessor player-username) - ;; Connection id - (client #:accessor player-client) + #:getter player-username) (self-commands #:init-value '() - #:accessor player-self-commands) + #:getter player-self-commands) (message-handler #:init-value