From: Erik V. <eri...@xs...> - 2011-07-23 15:32:45
|
BTW We should also keep this in mind: > From: Chris Shaffer [mailto:chr...@gm...] > Sent: Wednesday, May 04, 2011 4:39 PM > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] Obsolete Trains > In 1844, when a new type of train is purchased, the previous rank are converted into H trains. So a train can be converted into a quite different type. No big deal, I think. Erik. > -----Original Message----- > From: Stefan Frey [mailto:ste...@we...] > Sent: Thursday, July 21, 2011 7:18 AM > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] Hex trains support > > Erik, > I have only checked the methods that train and TrainType support instead of > having a look at the xml files ;-) > > I intend to keep it as closely to your current specification. So I agree with your > proposal. Considering your specification I only wonder why major and minor > are an attribute of the TrainType tag instead of Reach? > Maybe to keep the xml files more compact? > > The only change will be that there is an additional hexes attribute inside of > the TrainType tag, which should be used for hex trains. > > This attribute allows the separation of name and range (thus the hex train in > 1844 will be defined with a hexes attribute one less than their name). > > Some implementation questions: > > The main task is to add methods to support the variables and I will to that. > Just to be sure I understood your recent changes: > > TrainCerticate: One for each certificate > > TrainType: One for each type > > Train: One per train certificate (standard case), two per train certificate (dual > case) > > Train objects have a pointer to the TrainType object, which itself contains all > relevant attributes required for the revenue calculation. > > For the case of operating I can safely ignore the dual case as the operating > company has the correct trains in its portfolio. > > So I retrieve all trains for a company from the portfolio and for each train get > its TrainType and then query the TrainType for the attributes. > > To make this more transparent I suggest to remove all methods related to > range etc. from the Train class (and TrainI interface) and only keep those in > TrainType. I currently sometimes query the Train and sometimes the > TrainType and this seemed somehow inconsistent. > > Stefan > > > On Wednesday, July 20, 2011 10:52:02 am Erik Vos wrote: > > 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 > > > > ---------------------------------------------------------------------- > > ----- > > --- 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 > > ---------------------------------------------------------------------------- -- > 5 Ways to Improve & Secure Unified Communications Unified > Communications promises greater efficiencies for business. UC can improve > internal communications as well as offer faster, more efficient ways to > interact with customers and streamline customer service. Learn more! > http://www.accelacomm.com/jaw/sfnl/114/51426253/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |