Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9878) new function building_has_effect
Home

[Freeciv-Dev] Re: (PR#9878) new function building_has_effect

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9878) new function building_has_effect
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Mon, 30 Aug 2004 21:10:47 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Mon, 30 Aug 2004, Jason Short wrote:

> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9878 >
>
> This patch adds a new function building_has_effect.  This function takes
> a building type and an effect type and returns a boolean indicating
> whether the building provides the effect.  Unlike other functions which
> return the value of the effect, this one just returns a boolean.
> Finding the value of the effect requires more work (in theory) and also
> means knowing the range.  This function therefore will probably only
> ever work for some effects.
>
> Naturally this function is taken from the effects patch.
>
> To begin with only EFT_PROD_TO_GOLD (provided by B_CAPITAL) is supported.
>
> I had to move the improvement_type enumeration into fc_types.h to make
> this work.  Otherwise there is a circular dependency between
> improvement.h and effects.h.  Of course eventually this enum should turn
> into an int.  In the process of moving I removed the enum name (having
> it around might tempt people to _use_ it) and the unnecessary #define
> (unecessary IMO since when the time comes we can just change the code).

1. The reason I put fc_types.h before any other includes is to indicate
that ultimately a header file should only include fc_types.h at most.  But
maybe it's a wrong goal.

2. I assume building_has_effect will be extended soon.  So it will become
a switch and we can begin with a switch to save future diff lines.  Note
that it returns 0 whereas it should return bool.

3. Is this area controversial at all?  Because otherwise I would just
commit it.

G>




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