From: Stefan F. <ste...@we...> - 2012-01-29 18:19:44
|
Martin & Erik: I will only comment on the second item: The train lending feature of 1856 is implemented by having the PublicCompany_CGR extending a StaticRevenueModifier. Most likely a similar solution should work for 1880 as well. Stefan More details: This interface requires only one method to implement, see below the implementation for 1856. public boolean modifyCalculator(RevenueAdapter revenueAdapter) { // check if the running company is the cgr if (revenueAdapter.getCompany() != this) return false; // add the diesel train if (runsWithBorrowedTrain()) { revenueAdapter.addTrainByString("D"); return true; } return false; } Some remarks: * Static modifiers is called for all companies (so the modifier has to check if it the running company is actually the CGR). * The train used for revenue calculation is actually a "virtual" train, which is only created for the use of revenue calculation. > b) > > I believe this is the same situation as we have with 1856 if the CGR has > no train: it “borrows” the train that currently is on top of the IPO > stack. Effectively, it runs that train without ever getting it. I > think the same solution should apply to 1880. So we don’t need a new > portfolio: it already exists, and is called “IPO”. > > As for displaying a borrowed train: if that doesn’t already happen in > 1856, it’s probably a good idea to add it there too, so it would be a > generic feature. I would start checking out if updating TrainsModel > could cover such a case, e.g. by adding a method ‘useBorrowedTrain > (Portfolio ipo)’. Passing a reference to IPO would cause displaying the > first available IPO train in square brackets (for instance). Passing > null would switch that off and return to the normal display. > > Erik. > > *From:*Dr....@t-... [mailto:Dr....@t-...] > *Sent:* Sunday, January 29, 2012 12:22 AM > *To:* Rails Development > *Subject:* [Rails-devel] 1880 Implementation: Opinions wanted > > Hi, > > i would like to get some opinions for two todos next on my list. > > a) Major Companies in 1880 have their tile laying rights bound to a > "building" right. This will be determined not at creation of that > company but at Start based on the director share type and the player > chosing from a number of indefinetely available rights. > > In Connect with that "semi-static" Right, the company in question will > receive a numer of rights if the director of that company holds a > private (Taiwan, Ferry, Bridge). Its not linked to the company but > through the player to all companies he owns. > > If i want to display those right i think i'll have to make use of the > not yet fully implemented RightsModel Class. Any objections, different > approach suggestions here ? > > b) the train lending feature: For the Investors/Minor Companies the > currently in the bank available train is used to determine the Revenue. > > I would like to have that displayed in the companies portfolio and of > course used in the revenue calculation. > > I propose to generate a 4th heap/portfolio which will hold the not yet > leased/lent trains and then use a leaseTrain method that will move those > trains into the Minors portfolio upon start/event and move the already > listed trains to the scrap heap. > > Any ideas there ? Cause the low level approch of using the Portfolio > mechanismn directly is not what should be done or? (Besides we dont have > a removeTrain method thats visible outside of Portfolio for a reason > anyway.) > > Regards, > > Martin > > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > > > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |