From: Stefan F. <ste...@we...> - 2013-09-30 12:58:33
|
<html> <head> </head> <body>Seems to be more complicated, as it would add a ArrayListState instead of changing an Integer into a IntegerState. And going forward to Rails 2.0 it would require ownership of Certificates of other Certificates, as all ownable items need a defined owner. And Scrapheap is a defined owner.<br> I do not mind share being writable, as I assume as the code changing it is not malign.<br> I only mind writing to non-state fields as this breaks undo. In Rails 2.0 there is the general rule that all non-state variables have to be final. <br> <br><br><div class="gmail_quote">Michael Alexander <out...@gm...> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div> <div> Just as a thought, what would you think about having a method inside Public Certificate that you would call on the president's share, passing in another share, and inside the method it would "combine" them? That would eliminate exposing the share value to be written, and guarantee that exactly 100% of the company was still in play.<br/> <br/> </div> 1880 already has the change in the UI, so that is not a problem. :)<br/> </div> <div class="gmail_extra"> <br/> <br/> <div class="gmail_quote"> On Mon, Sep 30, 2013 at 6:57 AM, Stefan Frey<span> <<a href="mailto:ste...@we..." target="_blank">ste...@we...</a>></span> wrote:<br/> <blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;"> Again some quick comments, see below.<br/> <div> <div class="h5"> <br/> On 09/30/2013 05:45 AM, Michael Alexander wrote:<br/> > In 1880, a player choose upon opening a company if he wants that company<br/> > to have a 20%, a 30%, or a 40% president's certificate. This can't be<br/> > simulated by just giving them extra 10% shares at the start, because it<br/> > only counts as 1 against the share limit. Also, the president can't<br/> > sell down to 30% if he has a 40% president's share (assuming he isn't<br/> > dumping the company on someone who doesn't have 40%).<br/> ><br/> > Any advice on how to implement this?<br/> ><br/> <br/> </div> </div> My recommendations are identical to the last of your proposal, only<br/> pointing out to change share to an IntegerState.<br/> To avoid any misunderstanding I explain how I would do it.<br/> <br/> A) Change field shares in PublicCertficate class to an IntegerState to<br/> allow dynamic changes.<br/> <br/> B) Create a president certificates based on 20% definition and<br/> certificates of 10% for a full 100%.<br/> <br/> C) At the time purchase of the president certificate, if needed, change<br/> the value of share for the president certificate and move the redundant<br/> 10% certificates to the scrapheap (see Bank class). Change the value of<br/> share for those to zero.<br/> <br/> D) You will have to change the UI to allow choice of the president<br/> certificates shares and extend/augment the StartCompany/BuyCertificate<br/> actions for the additional choice.<br/> <br/> E) The change of president code in various StockRound class methods<br/> should still work, as the do not rely on the fixed assumption of 20% for<br/> the president share already. However extensive testing is recommended.<br/> <br/> The proposal ensurses the following assumptions at every point in the<br/> game and is undo-proof.<br/> <br/> 1) All certificates are created at initialization.<br/> 2) The sum of the field "share" of all certificates equals 100 /<br/> shareUnit, thus in 1880 10. "shareUnit" is a field of PublicCompany.<br/> <br/> Follow-up questions were:<br/> <div class="im"> <br/> > Are there other games that do it dynamically? Actually, the CGR in 1856 comes to mind...<br/> <br/> </div> I have no checked exactly how this is done in 1856, but if I remember<br/> correctly it is done similar. Maybe Erik can shed more light on this.<br/> <div class="im"> <br/> > One way that it could be done would be to start with a 20% share defined in the XML file,<br/> > then if during the floatCompany call it was determined I needed a 30% (or 40%) share instead,<br/> > I could up the shares value in the certificate and scrap one (or two) of the 10% shares.<br/> <br/> </div> nearly exactly what I outline in my own words above.<br/> <div class="HOEnZb"> <div class="h5"> <br/> ------------------------------------------------------------------------------<br/> October Webinars: Code for Performance<br/> Free Intel webinars can help you accelerate application performance.<br/> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from<br/> the latest Intel processors and coprocessors. See abstracts and register ><br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk</a><br/> _______________________________________________<br/> Rails-devel mailing list<br/> <a href="mailto:Rai...@li..." target="_blank">Rai...@li...</a><br/> <a href="https://lists.sourceforge.net/lists/listinfo/rails-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/rails-devel</a><br/> </div> </div> </blockquote> </div> <br/> </div> </blockquote></div></body> </html> |