<commit_before>(in-package :clobber)

;; TILES
(defclass tile ()
  ((blocks-light :accessor blocks-light :initform nil)
   (blocks-move :accessor blocks-move :initform nil)
   (sprite :accessor sprite :initform nil :initarg :sprite)
   (top-sprite :accessor top-sprite :initform nil :initarg :top-sprite)))

(defclass burnable ()
  ((burning :accessor burning :initform nil)))

(defclass grass (tile burnable) ())

(defclass abyss (tile)
  ((blocks-light :initform t)
   (blocks-move :initform t)))

(defclass unit ()
  ((x-position :accessor x-pos :initform 0          :initarg :x     :type fixnum)
   (y-position :accessor y-pos :initform 0          :initarg :y     :type fixnum)
   (hit-points :accessor hp    :initform nil        :initarg :hp    :type fixnum)
   (color      :accessor color :initform sdl:*cyan* :initarg :color :type sdl:color)))

(defclass item (unit)
  ((owner :initform nil)))

(defclass tool (item) ())

(defclass mob (unit container)
  ((race :accessor race :initform 'human :initarg :race)
   (level :initarg :level :accessor level)
   (hp :initarg :hp :accessor hp)
   (def :initarg :dex :accessor def)
   (att :initarg :str :accessor att)
   (tool :initarg nil :accessor tool)))

(defmacro make-container (name number-of-slots)
  `(defclass ,name () 
     ,(loop for i from 0 to number-of-slots
         collect (list (intern (concatenate 'string "slot-" (write-to-string i)))))))

(defmacro defholder (holder-name)
  (let ((slots))
    (maphash #'(lambda (key value)
                 (declare (ignore key))
                 (push (list value
                             :type 'simple-vector
                             :initform 'nil
                             :accessor value) slots)) *object-lookup-table*)
    `(defclass ,holder-name ()
       ,slots)))<commit_msg>Added defobject skeleton to classes.lisp<commit_after>(in-package :clobber)

;; TILES
(defclass tile ()
  ((blocks-light :accessor blocks-light :initform nil)
   (blocks-move :accessor blocks-move :initform nil)
   (sprite :accessor sprite :initform nil :initarg :sprite)
   (top-sprite :accessor top-sprite :initform nil :initarg :top-sprite)))

(defclass burnable ()
  ((burning :accessor burning :initform nil)))

(defclass grass (tile burnable) ())

(defclass abyss (tile)
  ((blocks-light :initform t)
   (blocks-move :initform t)))

(defclass unit ()
  ((x-position :accessor x-pos :initform 0          :initarg :x     :type fixnum)
   (y-position :accessor y-pos :initform 0          :initarg :y     :type fixnum)
   (hit-points :accessor hp    :initform nil        :initarg :hp    :type fixnum)
   (color      :accessor color :initform sdl:*cyan* :initarg :color :type sdl:color)))

(defclass item (unit)
  ((owner :initform nil)))

(defclass tool (item) ())

(defclass mob (unit container)
  ((race :accessor race :initform 'human :initarg :race)
   (level :initarg :level :accessor level)
   (hp :initarg :hp :accessor hp)
   (def :initarg :dex :accessor def)
   (att :initarg :str :accessor att)
   (tool :initarg nil :accessor tool)))

(defmacro defobject (name layer &rest slots)
  `(defclass ,name ()
     ((layer ,layer)
      ,slots)))

(defmacro make-container (name number-of-slots)
  `(defclass ,name () 
     ,(loop for i from 0 to number-of-slots
         collect (list (intern (concatenate 'string "slot-" (write-to-string i)))))))

(defmacro defholder (holder-name)
  (let ((slots))
    (maphash #'(lambda (key value)
                 (declare (ignore key))
                 (push (list value
                             :type 'simple-vector
                             :initform 'nil
                             :accessor value) slots)) *object-lookup-table*)
    `(defclass ,holder-name ()
       ,slots)))
{'fraction_non_alphanumeric': 0.1354389721627409, 'fraction_numerical': 0.0016059957173447537, 'mean_word_length': 2.8367556468172483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4685596', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1222, 'n_words': 372}