From: Erik V. <eri...@hc...> - 2008-12-23 20:41:26
|
I have committed a bunch of changes to the code base. Most of these deal with a more uniform handling of round initialization. This does not cause any functional changes, but it does look a bit better, and it also might help paving the way for better configurability of the sequence of rounds, most of which is now hardcoded. Last but not least, I think it will please Mark ;-) I have taken Jean's implicit hint and replaced GameManager.createRound() by two new methods of the same name, which create Round objects via one-argument and two-argument constructors, respectively. The one-argument constructor is used by "top-level" rounds (start, stock, operating rounds and 18EU's Final Minor Exchange Round), and pass the gameManager object that every round needs. The two-argument constructor is used by "subrounds", which briefly interrupt a top-level round, and get the parent round object in addition to the gameManager object. Existing subrounds are TreasuryShareRound and ShareSelling round, both being SR-like steps in an operating round. In a number of round classes I have also moved some initialization code from the start() methods to the constructors. The no-argument constructors are no longer used and have been removed (in Round it is now private). I have fairly extensively tested the consequences of all these changes, and while doing so I discovered and fixed a few long-standing bugs. The first and worst is, that in 18EU the Final Minor Exchange Round was started immediately after the OR in which the first 5-train was bought, rather than just before the next Stock Round (this makes a difference if the first 5-train is bought in an odd OR). Also, the first player to act was not the first but the last player buying a 5-train. It's unfortunate that I discovered these pretty serious bugs just hours after Brett announced the release of the new version 1.0.6. A second problem existed in 1830-style start rounds, where in some (I think rare) circumstances bidding (or rather: passing) would never end (perhaps Mark is right in disliking pass counting - that is where it went wrong in the case I found). For the rest the changes contain some cleanups and automatic comment/annotation insertions by Eclipse. Happy holidays to all of you. Erik |