From: Erik V. <eri...@xs...> - 2011-07-20 08:52:06
|
Stefan, My original intention was to set this attribute in the <Reach> tag. See this fragment from 1830/Game.xml: <Reach base="stops" countTowns="yes"/> <!-- Alternative values: base="hexes" for H-trains as in 1826, 1849 etc. countTowns="no" for all trains in 1841, 18EU, etc., where towns score but do not count against the train length. Otherwise, towns are counted as minor or major stops, depending on the presence or absence of a "minorStops" value. --> This all dates back to the early days when everything was provisional. It's basically up to you how to work this out for hex trains, but I'll express my thoughts below. I admit that 'base' is not very descriptive, these days I would probably have looked for a better word, something like 'reachBase' or 'countingBase'. But I doubt if it's worthwhile to change it. For the hex count you could reuse 'majorStops', but it's nicer to call it 'hexes'. Internally these could point to the same integer variable (or not). Keep in mind that in one game (1844) the hex count includes the starting hex; in all other H-train games it is excluded. Either another attribute must indicate this special case, or the official 'hexes' counts must be decreased by one in this game. You could also drop 'base' and detect from the presence of 'majorStops' or 'hexes' what type of train it is, but that's an approach that may not be to everybody's liking. In any case, these two attributes should exclude each other. If you ask for my personal preferences, the answer would be: - keep 'base' - use 'hexes' as an alias for 'majorStops' - don't add a special attribute for 1844. But, as said, it's up to you. Erik. > -----Original Message----- > From: Stefan Frey [mailto:ste...@we...] > Sent: Wednesday, July 20, 2011 8:18 AM > To: Development list for Rails: an 18xx game > Subject: [Rails-devel] Hex trains support > > Erik, > I have implemented revenue calculation for hex trains (for 1826). Instead of a > dynamic modifier I kept the (older) plan to add that to the revenue calculator > directly. So I treat hex trains as "first-class" citizens of Rails and they should > be supported directly via attributes in XML. > > What is your preference for the naming and type of such an attribute? > I would currently prefer a simple boolean isHexTrain = "yes" and (mis-) use > the number of majors as the number of hexes the train can travel. > > But maybe something like distanceType={stops|hexes} and then an integer > attribute for hexDistance is preferable? > Stefan > > ---------------------------------------------------------------------------- -- > 10 Tips for Better Web Security > Learn 10 ways to better secure your business today. Topics covered include: > Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, > security Microsoft Exchange, secure Instant Messaging, and much more. > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |