<commit_before>
(defpackage :things.t-sdl
  (:documentation "Screen handler for SDL things")
  (:use #:cl #:sdl #:things.generics)
  (:export #:t-sdl))

(in-package :things.t-sdl)

;; Local generics

(defgeneric update (updatable handler)
  (:documentation "Handles updatable's update changes."))

(defgeneric draw (drawable handler)
  (:documentation "Draws the drawable on the handler."))

;; T-SDL class

(defclass t-sdl (handler)
  ((updatables
    :initform nil
    :accessor updatables
    :documentation "List of objects with update method implementation.")
   (drawables
    :initform nil
    :accessor drawables
    :documentation "List of objects with draw method implementation."))
  (:documentation "This is the main handler for the SDL experiment screen."))

(defmethod startup ((handler t-sdl))
  "Starts up the SDL handler."
  (sdl:with-init (sdl:sdl-init-video sdl:sdl-init-audio)<commit_msg>Created message processor<commit_after>
(defpackage :things.t-sdl
  (:documentation "Screen handler for SDL things")
  (:use #:cl #:sdl #:things.generics)
  (:export #:t-sdl))

(in-package :things.t-sdl)

;; Local classes

(defclass message-processor ()
  ((message-type
    :initform (error "Processor must have a message type.")
    :accessor message-type
    :documentation "Type of the message this processor handles."))
  (:documentation "Processes messages of a type and handles related effects."))

;; Local generics

(defgeneric update (updatable handler)
  (:documentation "Handles updatable's update changes."))

(defgeneric draw (drawable handler)
  (:documentation "Draws the drawable on the handler."))

(defgeneric handle-message (message-processor message)
  (:documentation "Handles the event message."))

;; T-SDL class

(defclass t-sdl (handler)
  ((updatables
    :initform nil
    :accessor updatables
    :documentation "List of objects with update method implementation.")
   (drawables
    :initform nil
    :accessor drawables
    :documentation "List of objects with draw method implementation."))
  (:documentation "This is the main handler for the SDL experiment screen."))

(defmethod startup ((handler t-sdl))
  "Starts up the SDL handler."
  (sdl:with-init (sdl:sdl-init-video sdl:sdl-init-audio)
{'fraction_non_alphanumeric': 0.11727842435094002, 'fraction_numerical': 0.0, 'mean_word_length': 4.437956204379562, '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': '2034243', 'n_tokens_mistral': 718, 'n_tokens_neox': 647, 'n_words': 229}