;;; Mudsync --- Live hackable MUD ;;; Copyright © 2016 Christopher Allan Webber ;;; ;;; This file is part of Mudsync. ;;; ;;; Mudsync is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or ;;; (at your option) any later version. ;;; ;;; Mudsync is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with Mudsync. If not, see . ;;; Game actor ;;; ========== (define-module (mudsync gameobj) #:use-module (8sync systems actors) #:use-module (8sync agenda) #:use-module (oop goops) #:export ( gameobj-simple-name-f gameobj-loc gameobj-gm gameobj-name gameobj-name-f)) ;;; *all* game components that talk to players should somehow ;;; derive from this class. ;;; And all of them need a GM! (define-class () ;; location id (loc #:init-value #f #:accessor gameobj-loc) ;; game master id (gm #:init-keyword #:gm #:getter gameobj-gm) ;; a name to be known by (name #:init-keyword #:name #:accessor gameobj-name) ;; how to print our name (name-f #:init-keyword #:name-f #:getter gameobj-name-f #:init-value (wrap gameobj-simple-name-f)) ;; Name aliases (aliases #:init-keyword #:aliases #:init-value '()) ;; Commands we can handle (dirobj-commands #:init-value '()) (indirobj-commands #:init-value '()) ;; Commands we can handle by being something's container (contain-commands #:init-value #f)) (define (gameobj-simple-name-f gameobj) "Simplest version: return ourselves for our name." (gameobj-name gameobj))