wh-engine/wh-engine/systems.lisp

24 lines
743 B
Common Lisp
Raw Permalink Normal View History

2022-02-25 00:39:53 +00:00
;;;; wh-engine/systems.lisp
;;;; facilities for defining systems
(in-package wh-engine)
(defvar *system-registry* ()
"Alist of defined systems.")
(defvar *world-systems* ()
2022-02-26 20:19:04 +00:00
"List of installed systems.")
2022-02-25 00:39:53 +00:00
2022-02-26 20:19:04 +00:00
(defun register-system (name init-fun-symbol update-fun-symbol sdl-event-rules
&key dependencies)
(push `(,name ,init-fun-symbol ,update-fun-symbol
,sdl-event-rules
,dependencies)
*system-registry*))
2022-02-25 00:39:53 +00:00
(defun install-systems (&rest systems)
(loop for system-name in systems
for system = (assoc system-name *system-registry*)
2022-02-26 20:19:04 +00:00
do (pushnew system *world-systems*)
;; install dependencies
(apply #'install-systems (fifth system))))