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: Fri, 16 Jul 2004 02:46:29 -0700
Reply-to: rt@xxxxxxxxxxx

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

> > > 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..")

Any objections? I am going to write it that way (without  
secfile_insert_str_vec()).

And with new bitvector: c%d.improvements_new
I know that it is possible to construct savegame order which matches  
1.14.1 ruleset order (first 68 entries should be properly permuted).
There's 3 arguments against that solution:
- improvements_new is much easier to write
- when someone constructs ruleset with completly different buildings  
there will be 68 zeros in c%.improvements followed by really  
meaningfull values
- Backward compatibility with 1.14.1 will be eventually dropped after  
1.15 and it will be much easier with cleaner code.
--
mateusz




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