diff options
Diffstat (limited to 'src/game.lisp')
| -rw-r--r-- | src/game.lisp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game.lisp b/src/game.lisp index 40e201c..f0efd14 100644 --- a/src/game.lisp +++ b/src/game.lisp @@ -7,6 +7,7 @@ :get-profit :get-profit-in-zone :get-cur-zone + :get-zone :commodities-panel :player-stats)) @@ -60,9 +61,13 @@ (with-slots (cur-zone) g (get-profit-in-zone g name cur-zone))) +(defmethod get-zone ((g game) zone) + (with-slots (zones) g + (find-if (lambda (x) (string= (zone:name x) zone)) + zones))) -(defmethod commodities-panel ((g game)) - (with-slots (player cur-zone) g +(defmethod commodities-panel ((g game) zone) + (with-slots (player) g (mapcar (lambda (c) (let* ((name (commodities:name c)) (price (commodities:price c)) @@ -75,7 +80,7 @@ :price price :qty quantity :profit profit))) - (zone:get-commodities cur-zone)))) + (zone:get-commodities zone)))) (defmethod player-stats ((g game)) (with-slots (player) g |
