From: Erik V. <eri...@hc...> - 2005-03-05 10:24:46
|
> >> <game=1830> > >> <tile type=doesntCountTowardStockLimit color=yellow> > >> <tile type=canBuyMoreThanOnePerTurn color=orange> > > > >IMO, those are the standard meanings, and any games that > have the zones but > >color them differently should be displayed in the standard > colors instead. > > Sure, obviously this is more of an aesthetic feature than > anything else. > > However, I can almost guarantee that some people are going to > be pedantic enough > to complain about it at some point in time. So, I figure > that if we can easily do something > like my suggestion to allow us to define the "correct" colors > for each game's stock market, > it shouldn't be too difficult to get our stockmarket UI to > use those color definitions. Yesterday evening I've made the XML files for 1856 and 1870, and implemented the ledge (marking the square *below* the ledge was indeed the easiest way, Brett). You can see how these look like in HTML (from my test servlet) on http://home.hccnet.nl/erik.vos/18xx.html (needless to say that pressing the buttons will not work). For now I have settled on standard colours, but I agree with Brett that in the end product we should follow the game colours. Perhaps we could even let users customise colours! I don't know how colour coding works in Swing, but I think that at some point we will need to allow some mapping from background colour names to foreground RGB values. Besides, some games (1841, 1860) have colour-coded squares for quite different purposes. Which brings me to Brett's very appropriate remark that we should apply a Model/View separation. I am in fact only working on Model classes now, the two Views we have so far (console output in test.StockTest and HTML in game.test.StockMarketTestServlet) are just for testing. So IMO we should separate functionality (Model) from colour, which is presentation (View). A related question is *where* we are going to specify the presentation colours. Will we have separate XML files (or maybe property files) for the View side? Anyway, the current <square colour="orange"> is either wrong or incomplete. My suggestion would be to specify a brown (as in 1830) square by something like <square name="a6" price="25"> <noCertLimit/> <noHoldLimit/> <noBuyLimit/> </square> and leave it to the View class to decide from these (or other) booleans what colour that square will have. BTW I have chosen to represent booleans by embedded elements, as I don't like artificial attribute values like noCertLimit="1" or noCertLimit="yes" or noCertLimit="true". But that is more an aesthetical argument than anything else. Is there any best practice for how to represent booleans in XML? I also need a better but also short word for "square". "tile" (see above) is confusing. I see many games use "space", so I propose to settle on that name. Erik. |