[Freeciv-Dev] Re: Tech cost patch v3
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, Nov 28, 2001 at 04:52:14PM +0200, Juha Litola wrote:
> On Wed, Nov 28, 2001 at 03:05:29PM +0100, Petr Baudis wrote:
> > It doesn't look bad, only the coding style needs to be fined a bit, IMHO.
> It would help to know what it currently is ;)
>
> Included is modified patch with following chages:
> - Converted c++-style comments to c-style
> - Add capability tech_cost
> - Added cost field to advance-structure
> - Calculate costs only once
> - Converted if in tech_cost to switch
> - Got rid of floats
> - Changed for (i = 0; i < players; ++i) to player_iterate
>
> > Shouldn't you also modify ai/advmilitary.c ? >:)
> I hope not, I haven't got faintest idea what happens there. Someone
> more familiar with ai should probably check if modifications are
> needed.
>
> --
> // Juha Litola
> diff -u -b -r1.89 capstr.c
> --- common/capstr.c 2001/10/12 12:22:18 1.89
> +++ common/capstr.c 2001/11/28 14:55:25
> @@ -71,7 +71,7 @@
> */
>
> #define CAPABILITY "+1.11.6 conn_info pop_cost turn attributes
> new_bonus_tech"\
> -" fund_added processing_packets angrycitizen tile_trade init_techs"
> +" fund_added processing_packets angrycitizen tile_trade init_techs tech_cost"
You have to add a description below. I would also choose tech_cost_style.
> +/**************************************************************************
> + Count cost for technology recursively.
> + Do no call this function directly, use tech_cost instead.
> + Result is researchcost*(1+numparents)
> +**************************************************************************/
> +int tech_cost_rec(struct player *pplayer, int tech)
Replace with
int tech_cost_rec(struct player *pplayer, Tech_Type_id tech)
> +{
> + int price = game.researchcost;
> + if (tech == 0)
A_NONE
Also shouldn't this function be called "deep_num_of_requirements" or
similar?
> + int cost;
You should document this field.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
One nuclear bomb can ruin your whole day.
- [Freeciv-Dev] Tech cost patch, Juha Litola, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch, Juha Litola, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch, Juha Litola, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch, Raimar Falke, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch, Petr Baudis, 2001/11/28
- [Freeciv-Dev] Tech cost patch v3, Juha Litola, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch v3, Petr Baudis, 2001/11/28
- [Freeciv-Dev] Tech cost patch v4, Juha Litola, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch v4, Paul Zastoupil, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch v4, Juha Litola, 2001/11/28
- [Freeciv-Dev] Re: Tech cost patch v3,
Raimar Falke <=
- [Freeciv-Dev] Why not C++ style comments?, Raahul Kumar, 2001/11/29
- [Freeciv-Dev] Re: Why not C++ style comments?, Raimar Falke, 2001/11/29
- [Freeciv-Dev] C/C++ Compilers used with Freeciv, Raahul Kumar, 2001/11/29
- [Freeciv-Dev] Re: Why not C++ style comments?, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Why not C++ style comments?, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Why not C++ style comments?, Jules Bean, 2001/11/29
- [Freeciv-Dev] Say Yes to C++ style comments, Raahul Kumar, 2001/11/30
- [Freeciv-Dev] Re: Say Yes to C++ style comments, Daniel Sjölie, 2001/11/30
- [Freeciv-Dev] Re: Say Yes to C++ style comments, Reinier Post, 2001/11/30
[Freeciv-Dev] Re: Tech cost patch, Gregory Berkolaiko, 2001/11/28
|
|