From: Erik V. <eri...@xs...> - 2010-01-26 20:07:31
|
Both train issues have been fixed. The Pullmanns being discarded to to the scrapheap instead of the Pool was a stupid mistake by me. The problem with the second and subsequent copies of unlimited quantity trains was a sequence problem. I have been so stupid (again) to write the list of executed actions to the save file as one large ArrayList object, in stead of as a series of single action objects. The result is, that the whole list is deserialized and instances of all their referenced objects are sought for in one fell swoop, before any action has been executed. Each such train, however, is only created once its predecessor is bought. As a result, these train objects stay null, which causes the error. The fix is to check the train reference in BuyTrain objects on each access, and if null, instantiate it as yet. It would have been much better to read/deserialize *and* execute the action objects one by one. But I cannot change that without making all old saved files (i.e. my entire test set) unusable. (and apologies to non-technical readers for the above gibberish) Erik. -----Original Message----- From: Phil Davies [mailto:de...@gm...] Sent: Tuesday 26 January 2010 11:14 To: Development list for Rails: an 18xx game Subject: Re: [Rails-devel] Pullmanns etc. Ahh, slight issue I've just noticed. Pullmans that are discarded appear to vanish into thin air and are discarded form the game, rather than back to the pool where they should go. Phil 2010/1/25 Erik Vos <eri...@xs...>: > OK, I can reproduce it and will have another look. > Erik. > > -----Original Message----- > From: Phil Davies [mailto:de...@gm...] > Sent: Monday 25 January 2010 16:39 > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] Pullmanns etc. > (...) > So that's all really great, the infinite trains issues when loading a > saved game is still present although at least this one is easy to get > round. I'll have a hunt of this myself when I get more spare time as > well as finally getting started on things like the minor company info > etc. > > > > ---------------------------------------------------------------------------- -- > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > ---------------------------------------------------------------------------- -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |