OSDN Git Service

f1229bef117acd59e1eabe808dda38f95bd62307
[rulp/rulp.git] / layers / models.lisp
1 (in-package :layers)
2
3 (defgeneric create-entity (m))
4
5 (defclass model ()
6   ((name :initarg :name
7          :accessor name
8          :documentation "name of the model, it will be transfered to the entity when generated"
9          :initform "noname"
10          :type string)
11    (movement :accessor movement
12              :initarg :movement
13              :documentation "the speed of the model, it can be used in various ways depending on the game"
14              :initform 6.0)
15    (size :accessor size
16          :initarg :size
17          :documentation "the size of a model, it will be calculated with the grid for the dimension in board"
18          :type integer
19          :initform 1)
20    (interactions :initform '(movep usep pokep)
21                  :accessor interactions
22                  :initarg :interactions)
23    ))
24
25 (defmethod create-entity ((m model))
26   (let* ((return-entity m))
27     (change-class return-entity 'entity)
28     return-entity))