From: Erik V. <eri...@xs...> - 2010-07-05 20:06:53
|
Stefan, I'm afraid this does not sound like a very good idea to me. AFAIK, a comparator requires *every* instance to be comparable. And non-started companies without a price aren't really well comparable for defining operating order purposes. Defining operating order (there are now two methods doing that, for different purposes and with different output) does not only require sorting, but also prior selection of the objects eligible for ordering. Yes, I realize that my new getCompaniesInRunningOrder() method does order *all* companies (contrary to everything I have said above), but (thinking about it) that's probably rather a bug than a feature. For now it works, but I don't consider it durable. In all likelihood the current logic will need major changes when adding games like 1837 and 1844 with their many different company types. And for such purposes I'd rather subclass GameManager (which must be done anyway in most new games) than PublicCompany.* Another consideration: recent developments increasingly force me to move logic out of the 'static' objects (companies, trains, tiles etc.) and into the 'dynamic' Manager/Round objects. Your proposal goes somewhat in the opposite direction. Erik. * That's a separate subject. Company class hierarchies have been discussed before in this forum. That might be a good idea if Java would support multiple inheritance, but it doesn't. There are too many company types with different mixtures of special features, and I have given up of thinking about catching these in hierarchies. -----Original Message----- From: Stefan Frey (web.de) [mailto:ste...@we...] Sent: Sunday 04 July 2010 23:46 To: Development list for Rails: an 18xx game Subject: Re: [Rails-devel] Price tokens change order when moving up. Erik: do you mind if I move the definition of running order into the PublicCompany class and define a Comparator? I can still keep the new method in the GameManager, but the change would later simplify the migration to the new sequence model. Stefan On Sunday 04 July 2010 22:57:26 Erik Vos wrote: > (Switching to the proper group) > This has been fixed now - in Subversion! > > Erik. > > > _____ > > From: 18...@ya... [mailto:18...@ya...] On Behalf Of John > A. Tamplin > Sent: Friday 02 July 2010 00:17 > To: 18...@ya... > Subject: Re: [18xx] par value marker movement > > > > > On Thu, Jul 1, 2010 at 3:43 PM, Erik Vos <eri...@xs... > > <mailto:erik.vos%40xs4all.nl> > wrote: > > At the end of the SR, the companies are scanned for being sold out in the > > order in which they appear in the Game Status window. Any upward token > > moves > > are then executed in that order and follow the normal move rules. So I > > suspect that the token order gets reversed only if a 'lower' company > > token is on top of a 'higher' one. Or it could be the reverse...:-) > > Indeed we need > > a saved file to prove that. > > In any case, I would encourage to file it as a bug, so it will get proper > > attention at some point. > > The tokens are supposed to be processed in market order, which winds up > preserving the same stacking. ---------------------------------------------------------------------------- -- This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |