|
From: Peter S. <wa...@gm...> - 2008-01-29 12:40:55
|
How about simply using a LinkedHashMap? This guarantees that iteration follows the insertion order. On a related note, I noticed some time ago that conquered colonies sometimes have another building order. Has this been fixed since? (hadn't played in a ling time). Peter (sorry Michael for the private mail, forgot to "reply all") On 1/27/08, Michael Burschik <Mic...@gm...> wrote: > > Ryan Richard Faith wrote: > > I think an explicit sorting order for BuildingTypes would be a good way > to go. > > > > Cheers, > > Ryan > > > > On Jan 27, 2008 2:23 AM, Michael Burschik <Mic...@gm...> > wrote: > > > >> Olivier Schmitt wrote: > >> > >>> Hello all, > >>> > >>> I noticed a change in behavior between version 0.7.x and 0.8 trunk. > >>> It relates to the way the buildings are listed on the colony panel. > >>> On the 0.7 screenshot below, the first building is the town hall, the > >>> second one the carpenter's house and then the blacksmith. > >>> > >>> I have come to like the 0.7 ordering. > >>> But on the 0.8 screenshot below the depot appears first followed by > >>> distiller, weaver... > >>> > >>> This new 0.8 ordering is unfortunate I think. > >>> Would it be possible to revert to 0.7 behavior ? > >>> > >>> Regards, > >>> > >>> Olivier > >>> > >>> > >> This is due to the fact that we now store the Colony's buildings in a > >> Map rather than a List. For this reason, the order in which they are > >> returned when enumerating the Map is more or less random. In the > >> ColonyPanel, we could either iterate over the list of BuildingTypes and > >> display the present buildings in this order, or we could define an > >> explicit sorting order for BuildingTypes and use that instead. Your > call. > >> > >> Regards > >> > >> Michael > >> > > We could either add an appropriate attribute to the specification, or > allow the user to specify the preferred order. However, in the future, > we might have a graphical representation of the building list (as in > Colonization), and all the effort would be wasted. > > Regards > > Michael > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Freecol-developers mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freecol-developers > |