Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: [Patch] city_impr_type_iterate
Home

[Freeciv-Dev] Re: [Patch] city_impr_type_iterate

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Patch] city_impr_type_iterate
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Mar 2002 15:07:38 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Mar 06, 2002 at 12:03:46PM +0000, Ben Webb wrote:
> On Wed, 6 Mar 2002, Raimar Falke wrote:
> 
> > On Wed, Mar 06, 2002 at 06:33:51AM -0500, Jason Short wrote:
> > > What about the (currently nonexistent) improvement types that a city can 
> > > build more than one of?  Will they (hypothetically) be included multiple 
> > > times in the iteration?
> 
>       Support for such types would require many more changes throughout 
> the code anyway. It's a lot of work for very little (IMHO) tangible 
> benefit.
> 
> > This is the problem of the person who implements this. Nevertheless
> > this patch makes it easier. It unified test like:
> >  city_got_building(pcity, i)
> >  pcity->improvements[i] != I_NONE
> >  pcity->improvements[i] != 0
> >  pcity->improvements[i]
> 
>       Well sure, but the last two shouldn't really be used anyway, as 
> pcity->improvements should hold the values I_NONE etc. - i.e. it should 
> really be an enum. (You can blame me for this.) Why not just use 
> city_got_building() everywhere, though?

It turns out that the remaining code (without the
city_unit_type_iterate test) is quite clean. I only found a few
problems.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "The Internet is really just a series of bottlenecks 
  joined by high speed networks."
    -- Sam Wilson

Attachment: improvements1.diff
Description: Text document


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