Add admin interface

This commit is contained in:
Loic Guegan 2019-05-12 14:01:05 +02:00
parent 8cba94e081
commit 8e31de0793
4 changed files with 34 additions and 3 deletions

View file

@ -21,6 +21,12 @@
:initform nil
:accessor game-over)))
;;; Admin function
(defmethod admin ((g game) &key (move nil move-supplied-p))
(with-slots (snake) g
(when move-supplied-p (setf (nth 0 snake) move))))
;;; Class constructor to initialize the snake
(defmethod initialize-instance :after ((g game) &key)
(with-slots (snake initial-size initial-position) g