diff options
| author | El-BG-1970 <elouangros@hotmail.com> | 2022-08-04 18:47:24 +0200 |
|---|---|---|
| committer | El-BG-1970 <elouangros@hotmail.com> | 2022-08-04 18:47:24 +0200 |
| commit | 62d2646d4dbe4a3a35bd9b4449e5c5b67d36f233 (patch) | |
| tree | e8e60cf9cd00c27e216fbd4b100d64abf30001da /src/player.lisp | |
| parent | 5731684cca287633b7589c12ca1372eec5dc0f0a (diff) | |
| download | transacc-62d2646d4dbe4a3a35bd9b4449e5c5b67d36f233.tar.gz | |
implemented game:get profit
Diffstat (limited to 'src/player.lisp')
| -rw-r--r-- | src/player.lisp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/player.lisp b/src/player.lisp index 394cee9..32757d0 100644 --- a/src/player.lisp +++ b/src/player.lisp @@ -6,7 +6,8 @@ :get-debt :repay-debt :buy-item - :sell-item)) + :sell-item + :find-item)) (in-package :player) @@ -61,6 +62,10 @@ (+ cash (* (cdr stocked-item) (commodities:price item)))))))) +(defmethod find-item ((p player) name) + (with-slots (stock) p + (inventory:find-item stock name))) + (defmethod repay-debt ((p player) amount) (with-slots (debt cash) p (when (and (<= amount debt) |
