diff options
| author | El-BG-1970 <elouangros@hotmail.com> | 2022-08-26 16:56:03 +0200 |
|---|---|---|
| committer | El-BG-1970 <elouangros@hotmail.com> | 2022-08-26 16:56:03 +0200 |
| commit | b729d2f97a9002cd9810b07d5a8178c3f6dd83e9 (patch) | |
| tree | 2cc4d0d2baa09140660036a004f017616df4b75e /src/game.lisp | |
| parent | 4198d1ae1d53b87ad0dfcc489b0e90b7f69c6b23 (diff) | |
| download | transacc-b729d2f97a9002cd9810b07d5a8178c3f6dd83e9.tar.gz | |
added prices panel to gui and panel switching
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 |
