diff options
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)))) |
