From 8a51ba81c7df6b0b6dab7cf4b35b5ca084b653ba Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 10 Dec 2024 07:11:02 -0800 Subject: Replaced defclass-std with def --- examples/10-canvas-sneks.lisp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'examples/10-canvas-sneks.lisp') diff --git a/examples/10-canvas-sneks.lisp b/examples/10-canvas-sneks.lisp index ef5d1d5..52c71fd 100644 --- a/examples/10-canvas-sneks.lisp +++ b/examples/10-canvas-sneks.lisp @@ -2,25 +2,24 @@ (defpackage #:ww.examples/10 (:use #:cl) - (:export #:start) - (:import-from #:defclass-std #:defclass/std)) + (:export #:start)) (in-package #:ww.examples/10) ;;; CLASSES -(defclass/std sneking (ww:application) - ((sneks snek-pit) - (population :std 10))) - -(defclass/std snek () - ((x y) - (dx dy :std 1) - (brain :std 0.0) - (bod :std (list)) - (len :std 4) - (color :std (list 255 255 255)) - (home :std (list 0 0 100 100)))) +(def:class sneking (ww:application) + (sneks snek-pit :initform nil) + (population :initform 10)) + +(def:class snek () + (x y dx dy :initform 1) + (brain :initform 0.0) + (bod :initform (list)) + (len :initform 4) + (color :initform (list 255 255 255)) + (home :initform (list 0 0 100 100)) + :documentation "A SNEK is a contiguous chain of virtual pixels (i.e. square blocks of color), all the same coloor") (defun snek-is-home-p (snek) (with-slots (x y home) snek -- cgit v1.2.3