From: Erik V. <eri...@hc...> - 2008-10-30 21:57:55
|
I have implemented initial unavailability of shares. This applies to 1856 (CGR) and 1835 (most companies). The complex IPO share availability rules of 1835 have been hardcoded in a new class StockRound_1835. This includes the 4 10% Prussian shares that come available when the Badische starts (the Prussian exchange rules have not been implemented yet). I didn't find it worthwhile to invent an XML structure to make all these rules configurable. Testing the share buying rules of 1835 also uncovered several bugs and missing features, so quite a number of classes have been affected. Erik Vos |
From: John A. T. <ja...@ja...> - 2008-10-30 22:53:55
|
On Thu, 30 Oct 2008, Erik Vos wrote: > I didn't find it worthwhile to invent an XML > structure to make all these rules configurable. I agree -- since Java can load classes dynamically, it is better to write code in a real programming language than trying to extend XML to be a programming language. A long time ago I used the same approach for a Java implementation of Cosmic Encounter (the cards all have arbitrary powers that alter the rules of the game). New cards could be loaded by just including additional jars in a directory, and the game loaded all the cards that were defined there. Perhaps Rails could be structured such that support for new games could be delivered the same way, once the core supported all the mechanisms that any of the games might need. -- John A. Tamplin ja...@ja... 770/436-5387 HOME 4116 Manson Ave Smyrna, GA 30082-3723 |
From: Mark S. <mar...@gm...> - 2008-10-31 13:46:03
|
Erik, I pulled down your latest updates, and went to see if I could resolve the 18AL Bug report about not being able to upgrade tiles... and ran into a bug in your updates, that generates a NULL Pointer when trying to purchase the last Private (giving out the President's Share). It looks like in the StockRound Class, the setBuyableCerts routine (line 179) attempts to get the cost of the purchase with the call: price = comp.getParPrice().getPrice () * cert.getShares (); When I look at the PublicCompany.java Class, and the GetParPrice routine, it is checking the flag "hasParPrice" -- which is set to -TRUE- (this is wrong since the price has not been set yet via dialog). and then it returns: return parPrice != null? parPrice.getPrice() : null; and if -FALSE- it returns: return currentPrice != null ? currentPrice.getPrice () : null; In the -TRUE- Case, it will return the parPrice StockSpace. In the -FALSE- case, it is returning the Current Stock Value, and not the Par Price Value which is implied by the routine name. So if the -hasParPrice- variable is NOT set, it tries to get the currentPrice. And this should not be set either... This routine looks wierd. Would it make sense to add a routine like: public int getParPrice () { /* Get the ParPrice StockSpace with the first getPrice call, and get the actual int value with the second call */ return parPrice != null ? parPrice.getPrice().getPrice() : 0; } So if you want the Int Value of the Par Price... you call the routine, and allow JAVA to use the appropriate routine? In this case like 179 of StockRound.java would be: price = comp.getParPrice () * cert.getShares (); Note, it Appears in 1830 I can set price for B&O, and buy it, but once the Stock Round starts, I have no stocks available to buy in the IPO. And I get the same NULL Pointer Exception on Line 179 of Stock Round. Mark On Thu, Oct 30, 2008 at 5:53 PM, John A. Tamplin <ja...@ja...> wrote: > On Thu, 30 Oct 2008, Erik Vos wrote: > > > I didn't find it worthwhile to invent an XML > > structure to make all these rules configurable. > > I agree -- since Java can load classes dynamically, it is better to write > code in a real programming language than trying to extend XML to be a > programming language. > > A long time ago I used the same approach for a Java implementation of > Cosmic Encounter (the cards all have arbitrary powers that alter the rules > of the game). New cards could be loaded by just including additional > jars in a directory, and the game loaded all the cards that were defined > there. Perhaps Rails could be structured such that support for new games > could be delivered the same way, once the core supported all the > mechanisms that any of the games might need. > > -- > John A. Tamplin ja...@ja... > 770/436-5387 HOME 4116 Manson Ave > Smyrna, GA 30082-3723 > > ------------------------------------------------------------------------- > 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&url=/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Brett L. <wak...@gm...> - 2008-10-31 17:00:10
|
Now that we're seeing more activity, and more discussion about specific commits, I've finally completed one of the more long-standing items on my todo list: I've created a rails-commits mailing list, and set up cvs syncmail to send commits to that list. Note: I *just* submitted the request to create the mailing list, so it'll take 6-24 hours to actually show up and allow people to subscribe. Anyone interested in following our commit activity should subscribe. However, any discussion about the commit should still happen on the rails-devel mailing list. Please consider the rails-commits list a read-only list. ---Brett. Better by far you should forget and smile than that you should remember and be sad. -- Christina Rossetti |
From: Erik V. <eri...@hc...> - 2008-10-31 20:14:24
|
I pulled down your latest updates, and went to see if I could resolve the 18AL Bug report about not being able to upgrade tiles... and ran into a bug in your updates, that generates a NULL Pointer when trying to purchase the last Private (giving out the President's Share). It looks like in the StockRound Class, the setBuyableCerts routine (line 179) attempts to get the cost of the purchase with the call: price = comp.getParPrice().getPrice () * cert.getShares (); When I look at the PublicCompany.java Class, and the GetParPrice routine, it is checking the flag "hasParPrice" -- which is set to -TRUE- (this is wrong since the price has not been set yet via dialog). and then it returns: return parPrice != null? parPrice.getPrice() : null; and if -FALSE- it returns: return currentPrice != null ? currentPrice.getPrice () : null; In the -TRUE- Case, it will return the parPrice StockSpace. In the -FALSE- case, it is returning the Current Stock Value, and not the Par Price Value which is implied by the routine name. So if the -hasParPrice- variable is NOT set, it tries to get the currentPrice. And this should not be set either... This routine looks wierd. Yes, I think it actually means "getInitialPrice" or such, although it seems to be used in various ways. But hasParPrice() only means that a company has a fixed price for buying unsold certificates. In many games, all shares are sold at current market price, even from IPO (although I think in most cases unsold shares are moved to the company treasury when a company floats). In that case hasParPrice() is false. Would it make sense to add a routine like: public int getParPrice () { /* Get the ParPrice StockSpace with the first getPrice call, and get the actual int value with the second call */ return parPrice != null ? parPrice.getPrice().getPrice() : 0; } So if you want the Int Value of the Par Price... you call the routine, and allow JAVA to use the appropriate routine? In this case like 179 of StockRound.java would be: price = comp.getParPrice () * cert.getShares (); Note, it Appears in 1830 I can set price for B&O, and buy it, but once the Stock Round starts, I have no stocks available to buy in the IPO. And I get the same NULL Pointer Exception on Line 179 of Stock Round. OK, my recent changes appear to have broken this. In StockRound, I had to move around code a bit to enable buying non-president shares before starting a company, as is allowed in some games for "government companies", like the 1835 Prussian and the 18Scan SJ, but I had not really tested that "normal" company starts would still work :-( I'll sort this out today or tomorrow. This whole matter clearly needs a closer look. I'll look at your suggestions as well. Erik. |
From: Erik V. <eri...@hc...> - 2008-10-31 20:18:31
|
> > I didn't find it worthwhile to invent an XML > > structure to make all these rules configurable. > > I agree -- since Java can load classes dynamically, it is > better to write > code in a real programming language than trying to extend XML to be a > programming language. > > A long time ago I used the same approach for a Java implementation of > Cosmic Encounter (the cards all have arbitrary powers that > alter the rules > of the game). New cards could be loaded by just including additional > jars in a directory, and the game loaded all the cards that > were defined > there. Perhaps Rails could be structured such that support > for new games > could be delivered the same way, once the core supported all the > mechanisms that any of the games might need. Yes, that is more of less my goal as well. I regularly find myself adding more hooks to load classes dynamically. Erik. |
From: Erik V. <eri...@hc...> - 2008-10-31 20:41:40
|
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. |
From: Mark S. <mar...@gm...> - 2008-10-31 20:56:35
|
Erik, 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. 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. 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. 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&url=/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
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 |
From: Mark S. <mar...@gm...> - 2008-10-31 21:26:13
|
I ran through a quick test on 1830, and it sets the price, but throws the same NULL Pointer on the same line. And after that there are still no available shares to be bought in the Stock Round Window. So the fix did not resolve the problem entirely. (there may be another NULL Pointer being thrown). I would point it out to you, but a Puppy on my lap is keeping me from proper debugging mode. Mark On Fri, Oct 31, 2008 at 4:11 PM, Erik Vos <eri...@hc...> wrote: > 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 > > |
From: Mark S. <mar...@gm...> - 2008-10-31 22:49:17
|
Hmmm... it must have been the Puppy... I re-checked and found I had updated the code but not rebuilt it. It does operate properly. Sorry for the mis-report. Mark On Fri, Oct 31, 2008 at 4:25 PM, Mark Smith <mar...@gm...> wrote: > I ran through a quick test on 1830, and it sets the price, but throws the > same NULL Pointer on the same line. And after that there are still no > available shares to be bought in the Stock Round Window. > > So the fix did not resolve the problem entirely. (there may be another NULL > Pointer being thrown). I would point it out to you, but a Puppy on my lap is > keeping me from proper debugging mode. > > Mark > > > On Fri, Oct 31, 2008 at 4:11 PM, Erik Vos <eri...@hc...> wrote: > >> 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 >> >> > |
From: Mark S. <mar...@gm...> - 2008-11-02 00:06:12
|
Erik, Another issue with the Stock Value. I ran across a bug that is a bit obscure, but the code does prevent an illegal action: Situation: Player Mark has $56 Cash. The Par Value of the Stock is $60, but the Current Market Value is $55. The Stock Info Table shows during a Stock Round that I should be able to buy an IPO Share, based upon sufficient Cash Check. I select to purchase, and the display asks to confirm that you want to buy the Share at $55 (Current Market Value -- This is wrong because I am trying to buy from IPO at PAR Value). The followup test when attempting to complete the purchase fails and generates a complaint about insufficient funds. This might not come up much, but the code is comparing Current Cash against Current Stock Value and not against Par Value for IPO Purchases. Mark |
From: Erik V. <eri...@hc...> - 2008-11-02 16:33:58
|
Situation: Player Mark has $56 Cash. The Par Value of the Stock is $60, but the Current Market Value is $55. The Stock Info Table shows during a Stock Round that I should be able to buy an IPO Share, based upon sufficient Cash Check. I select to purchase, and the display asks to confirm that you want to buy the Share at $55 (Current Market Value -- This is wrong because I am trying to buy from IPO at PAR Value). The followup test when attempting to complete the purchase fails and generates a complaint about insufficient funds. Right. This is another consequence of the messy situation around share prices in StockRound.setBuyableCerts(), possibly caused by my recent reorganisation of that code. I'm still planning to sort this out a.s.a.p, but I'm currently somewhat ill and so it may take a bit longer than foreseen. Erik. |
From: Brett L. <wak...@gm...> - 2008-10-31 18:09:46
|
On Fri, 2008-10-31 at 10:50 -0700, Brett Lentz wrote: > Note: I *just* submitted the request to create the mailing list, so > it'll take 6-24 hours to actually show up and allow people to subscribe. It appears that the mailing list is up and running. Subscribe away. ---Brett. I'd give my right arm to be ambidextrous. |
From: Mark S. <mar...@gm...> - 2008-10-31 20:16:42
|
OK -- Remind silly me how to subscribe to the mailing list. I thought it was as simple as sending an e-mail to rai...@li... with the subject of 'Subscribe' and body containing 'Subscribe'. I tried that, and it bounced because I did not know of the destination address. Alternatively, which I feel would be better is how do I set up an RSS Reader if I had the proper URL that would spit out that results... like those listed on https://sourceforge.net/export/rss2_project.php?group_id=132173 Would that be possible? Mark On Fri, Oct 31, 2008 at 1:09 PM, Brett Lentz <wak...@gm...> wrote: > On Fri, 2008-10-31 at 10:50 -0700, Brett Lentz wrote: > > Note: I *just* submitted the request to create the mailing list, so > > it'll take 6-24 hours to actually show up and allow people to subscribe. > > > It appears that the mailing list is up and running. Subscribe away. > > > ---Brett. > > I'd give my right arm to be ambidextrous. > > > > ------------------------------------------------------------------------- > 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&url=/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Brett L. <wak...@gm...> - 2008-10-31 20:22:22
|
On Fri, 2008-10-31 at 15:16 -0500, Mark Smith wrote: > OK -- Remind silly me how to subscribe to the mailing list. > To subscribe, go here: https://lists.sourceforge.net/lists/listinfo/rails-commits > I thought it was as simple as sending an e-mail to > rai...@li... with the subject of 'Subscribe' > and body containing 'Subscribe'. I tried that, and it bounced because > I did not know of the destination address. > > Alternatively, which I feel would be better is how do I set up an RSS > Reader if I had the proper URL that would spit out that results... > like those listed on > > https://sourceforge.net/export/rss2_project.php?group_id=132173 > > Would that be possible? > Unfortunately, there's not a clear way to provide an rss feed of the mailing list. I'm sure it's technically possible, but the amount of effort involved makes it impractical. Also, as a mailing list, it allows you to quickly compose a reply e-mail without ever leaving your mail client. > Mark ---Brett. Did you know that clones never use mirrors? -- Ambrose Bierce, "The Devil's Dictionary" > On Fri, Oct 31, 2008 at 1:09 PM, Brett Lentz <wak...@gm...> > wrote: > On Fri, 2008-10-31 at 10:50 -0700, Brett Lentz wrote: > > Note: I *just* submitted the request to create the mailing > list, so > > it'll take 6-24 hours to actually show up and allow people > to subscribe. > > > > It appears that the mailing list is up and running. Subscribe > away. > > > ---Brett. > > I'd give my right arm to be ambidextrous. > > > > |