summaryrefslogtreecommitdiffstats
path: root/src/player.lisp
blob: f6ee371a8c7a80dadba707b24cbbd2d090f6d9d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(defpackage player
  (:use :cl)
  (:export :init-player
		   :name))

(in-package :player)

(defclass inventory ()
  ((size :initarg :size
		 :reader size)
   (filled :initform 0
		   :accessor filled)
   (items :initform '()
    	  :accessor items)))

(defclass player ()
  ((name :initarg :name
		 :reader name)
   (cash  :initarg :cash
		  :accessor cash)
   (debt  :initarg :debt
		  :accessor debt)
   (hp   :initform 100
		 :accessor hp)
   (clout :initform 0
		  :accessor clout)
   (stash :initform 0
		  :accessor stash)
   (stock :initform  (make-instance 'inventory :size 100)
		  :accessor stock)))

(defun init-player (name &optional (cash 2000) (debt 5000))
  (make-instance 'player
				 :name name
				 :cash cash
				 :debt debt))