;; Copyright © 2026 Genworks International
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU Affero General Public License as
;; published by the Free Software Foundation, either version 3 of the
;; License, or (at your option) any later version.  Distributed WITHOUT
;; ANY WARRANTY; see <https://www.gnu.org/licenses/agpl-3.0.html>.

(in-package :gdl-user)

(define-object settable-slots (base-object)

  :computed-slots
  ((speed 25 :settable)
   (time 15 :settable)
   (distance (* (the speed) (the time)) :settable))

  :functions
  ((set-speed! (&key (value 20)) (the (set-slot! :speed value)))
   (set-time! (&key (value 10)) (the (set-slot! :time value)))
   (set-distance! () (the (set-slot! :distance 100)))
   (reset-distance! () (the (restore-slot-default! :distance)))
   (reset-all! () (the (restore-slot-defaults! (list :speed :time :distance))))))

