aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <pouar@pouar.net>2020-07-15 14:12:18 -0500
committerGravatar Pouar <pouar@pouar.net>2020-07-15 14:12:18 -0500
commitfa71997491dfacc80dd91582e8ab670de4029342 (patch)
tree1c1d40f05b7ebfd77b923686c2aeef168e5178fb
parentallow more variations of yadfa:defmatch (diff)
rename yadfa::element-type-metaclass to yadfa::element-type-class
-rw-r--r--core/classes.lisp10
-rw-r--r--core/libexec.lisp4
2 files changed, 7 insertions, 7 deletions
diff --git a/core/classes.lisp b/core/classes.lisp
index 17bdee1..19ba55a 100644
--- a/core/classes.lisp
+++ b/core/classes.lisp
@@ -17,13 +17,13 @@
(:documentation "All the classes that are part of the game's core inherit this class"))
(defclass battle-script-mixin () ())
(defclass attack-mixin () ())
-(defclass element-type-metaclass (standard-class) ((name :initform nil)))
-(defmethod name-of ((class element-type-metaclass))
+(defclass element-type-class (standard-class) ((name :initform nil)))
+(defmethod name-of ((class element-type-class))
(or (slot-value class 'name) (class-name class)))
-(defmethod c2mop:validate-superclass ((class element-type-metaclass) (superclass standard-class)) t)
-(defmethod c2mop:validate-superclass ((class standard-class) (superclass element-type-metaclass))
+(defmethod c2mop:validate-superclass ((class element-type-class) (superclass standard-class)) t)
+(defmethod c2mop:validate-superclass ((class standard-class) (superclass element-type-class))
(error 'simple-error :format-control "Either you didn't use ~s to define ~s or you tried to inherit a class not defined with ~s" :format-arguments `(define-type ,(class-name class) define-type)))
-(defclass element-type () () (:metaclass element-type-metaclass))
+(defclass element-type () () (:metaclass element-type-class))
(defclass element-type-mixin () ((element-type :accessor element-type-of :initform nil :initarg :element-type)))
(defmethod print-object ((o element-type) s)
(let ((class (slot-value (class-of o) 'name)))
diff --git a/core/libexec.lisp b/core/libexec.lisp
index de209f7..316615b 100644
--- a/core/libexec.lisp
+++ b/core/libexec.lisp
@@ -166,7 +166,7 @@
t)))
(defmacro define-type (name (&rest superclasses) (&rest slot-specifiers) &rest class-options)
`(progn (defclass ,name (,@superclasses element-type) ,slot-specifiers
- (:metaclass element-type-metaclass)
+ (:metaclass element-type-class)
,@(iter (for class-option in class-options)
(unless (s:memq (car class-option) '(:super-effective :not-very-effective :no-effect :element-name))
(collect class-option))))
@@ -175,7 +175,7 @@
(when (s:memq option-name '(:super-effective :not-very-effective :no-effect))
(appending (iter (for target in (cdr class-option))
(collect `(unless (find-class ',target nil)
- (defclass ,target (element-type) () (:metaclass element-type-metaclass))))
+ (defclass ,target (element-type) () (:metaclass element-type-class))))
(collect `(defmatch ,name ,target ,option-name)))))
(collect `(setf (slot-value (find-class ',name) 'name) ,(if (eq option-name :element-name)
(second class-option)