diff options
authorGravatar Pouar <pouar@pouar.net>2020-07-17 18:29:02 -0500
committerGravatar Pouar <pouar@pouar.net>2020-07-17 18:29:02 -0500
commit06dbcf7151cb8becdaeeb4e6dd59cc2e07441ef6 (patch)
parentadd new element types (diff)
remove element-type-mixin
as what goes into the slots of the 2 classes that use them are different
1 files changed, 14 insertions, 3 deletions
diff --git a/core/classes.lisp b/core/classes.lisp
index ff33820..b0da297 100644
--- a/core/classes.lisp
+++ b/core/classes.lisp
@@ -24,7 +24,6 @@
(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-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)))
(if class
@@ -54,7 +53,7 @@
(:method (source (target (eql nil)))
-(defclass base-character (yadfa-class element-type-mixin)
+(defclass base-character (yadfa-class)
:initarg :name
:initform :missingno.
@@ -67,6 +66,12 @@
:accessor description-of
:type (or keyword string)
:documentation "Description of the character")
+ (element-type
+ :accessor element-type-of
+ :initform nil
+ :initarg :element-type
+ :type list
+ :documentation #.(f:fmt nil "a list of " (ref element-type :class) "s or symbols that makes @code{CL:MAKE-INSTANCE} return one when passed to it"))
:initarg :health
:accessor health-of
@@ -311,7 +316,7 @@
:accessor persistentp
:documentation "Whether items or moves that cure statuses cure this"))
(:documentation "Base class for all the status conditions "))
-(defclass move (yadfa-class attack-mixin element-type-mixin)
+(defclass move (yadfa-class attack-mixin)
:initarg :name
:initform :-
@@ -324,6 +329,12 @@
:type (or keyword string)
:accessor description-of
:documentation "Description of move")
+ (element-type
+ :accessor element-type-of
+ :initform nil
+ :initarg :element-type
+ :type (or (and symbol (not keyword)) element-type)
+ :documentation #.(f:fmt nil "a " (ref element-type :class) " or symbol that makes @code{CL:MAKE-INSTANCE} return one when passed to it"))
:initarg :energy-cost
:initform 0