diff options
| author | El-BG-1970 <elouangros@hotmail.com> | 2022-08-07 13:45:02 +0200 |
|---|---|---|
| committer | El-BG-1970 <elouangros@hotmail.com> | 2022-08-07 13:45:02 +0200 |
| commit | 3a9bb4886317e82aee1a45e4b643b5973c5215f9 (patch) | |
| tree | 9fb2893a48baa2468c152e4fdf351e01ab03ff61 /src/game.lisp | |
| parent | 62d2646d4dbe4a3a35bd9b4449e5c5b67d36f233 (diff) | |
| download | transacc-3a9bb4886317e82aee1a45e4b643b5973c5215f9.tar.gz | |
implemented game;commodities-panel
Diffstat (limited to 'src/game.lisp')
| -rw-r--r-- | src/game.lisp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/game.lisp b/src/game.lisp index 979e4e2..b55224a 100644 --- a/src/game.lisp +++ b/src/game.lisp @@ -55,3 +55,20 @@ (defmethod get-profit ((g game) name) (with-slots (cur-zone) g (get-profit-in-zone g name cur-zone))) + + +(defmethod commodities-panel ((g game)) + (with-slots (player cur-zone) g + (mapcar (lambda (c) + (let* ((name (commodities:name c)) + (price (commodities:price c)) + (player-item (player:find-item player name)) + (quantity (if player-item (cdr player-item) 0)) + (profit (if player-item + (- price + (commodities:price (car player-item)))))) + (list name + price + quantity + profit))) + (zone:get-commodities cur-zone)))) |
