From: Erik V. <eri...@hc...> - 2008-10-31 21:11:58
|
Note in the PublicCompany Class, the routine to get the ParPrice, and hasParPrice are checking the boolean flag 'hasParPrice. What I really don't understand is why have this boolean at all? If the company has a Par Price, the variable 'parPrice' will NOT be null. hasParPrice is a static (not in the java sense) game parameter, set at game loading time. It only means: there is a par price that is not necessarily equal to the current price. This price does not need to have been set yet. One use of hasParPrice is to create an extra"ParPrice" column in the Game status, which is absent in games like 1851 that do not have a separate par price. parPrice is 0 until a price has been set. If it is null, than there is no Par Price. Now, if you are trying to use the boolean hasParPrice to indicate that the Company is available for purchase, then it should be named 'availableForPurchase'. This way you can have a "Fixed" Par Price set before you can actually buy the stock. Yes, but that it not what it means. But your "fix" to change line 178 to 'if (comp.getParPrice() != null) {' moves the test from the PublicCompany Class back out to the setBuyableCerts Class which I feel is not right right way to fix it. If you have the 'hasParPrice' routine perform the test instead it would be a better solution. Perhaps we need a extra method hasAPriceBeenSet or such. We'll see. Mark On Fri, Oct 31, 2008 at 3:41 PM, Erik Vos <eri...@hc...> wrote: I have provisionally fixed the bug reported by Mark. Company starts now seem to work again. Over the weekend I will try to rationalise the company price routines. It's indeed a bit of a mess. Erik. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100 <http://moblin-contest.org/redirect.php?banner_id=100&url=/> &url=/ _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |