From: Brett <wak...@ea...> - 2005-04-18 03:39:59
|
I've added the code to draw a token in ui/StockChit and the logic to do so in ui/StockChart. I added a boolean in game/StockSpace called hasTokens to make it easy to figure out if a particular stock space has any tokens on it. I added a getter and setter for this new variable as well as inserted logic to toggle the boolean in some of the other methods within the StockSpace class. My current idea on how to put the tokens onto the Stock Market is to insert them as part of drawing the whole chart. Unfortunately this is making it rather difficult to test this because PublicCompany only accepts a StockSpace for setCurrentPrice, so I'm hitting a chicken and egg problem when it comes time to draw each StockSpace within the StockChart. I suspect the solution is that this single method ought to be broken up into two separate methods that allow easy cross-indexing with the information contained in a StockSpace: setCurrentPrice(int p) setCurrentGridLocation(String coord) or setCurrentGridLocation(int x, int y) Or perhaps I'm missing an easier solution entirely... ---Brett. Bugs, pl. n.: Small living things that small living boys throw on small living girls. |