Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Re: (PR#9193) Save worklists and city production by name
Home

[Freeciv-Dev] Re: (PR#9193) Save worklists and city production by name

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9193) Save worklists and city production by name
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 13 Jul 2004 04:16:29 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9193 >

On 2004-07-13 10:51:03, Jason Dorje Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9193 >
> 
> Mateusz Stefek wrote:
> >
> >>With attached patch worklists and city productions are no more
> >>dependent on the order in which improvements or units are read from
> >>ruleset.
> 
> I'd still like for someone to verify that the arrays in savegame.c
> correspond to the current (or 1.14.1) improvement values.
  I checked it once again. It looks OK.
> > How should I implement it?
> > Each city has its improvements list which is currently saved as
> > bitvector ("00101001..")
> > My idea is to save it as text which is divided with some special
> > character.
> > For example: "Temple|Granary|Harbour".
> 
> Here it becomes ugly.  Writing out "temple" for every city that has a
> temple seems way too inefficient.
> 
> Maybe it would be better to store the order separately and use that  
> to
> 
> recover the values from the array.
> 
>    all_improvements = "Temple", "Granary", "Harbour", ...
>    bitvector = 101...
I like it.
Backward compatibility complicates it a bit if we don't want two  
vectors in a city.
And there is no secfile_insert_str_vec() function!. That's why  
all_improvements need to be one string("Airport|Aqueduct|Bank..")

> Or maybe the registry code can do this automatically if you lookup
> city%d.has_%s (where %d = city ID and %s = improvement name).
> Probably
> this is the way to go.
This is bad idea. We don't need 68 new registry entries for each city.

> jason
>
--
mateusz




[Prev in Thread] Current Thread [Next in Thread]