[Freeciv-Dev] Re: [IAMBACK] [PATCH] [1.3] cleanup of proccess_*_want() (
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dear diary, on Sat, Apr 06, 2002 at 01:04:33PM CEST, I got a letter,
where Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
> > + /* We first need to develop a tech required by the unit... */
> > +
> > + /* Cost (shield equivalent) of gaining these techs. */
> > + /* FIXME? Katvrr advises that this should be weighted more heavily
> > in
> > + * big danger. */
> > + int tech_cost = total_bulbs_required_for_goal(pplayer,
> > + unit_types[unit_type].tech_requirement) / 4
> > + / city_list_size(&pplayer->cities);
> > +
>
> This was great. I like the use of tech_cost. A big improvement in legibility.
/me bows
> > -static void process_attacker_want(struct player *pplayer,
> > - struct city *pcity, int b, Unit_Type_id n,
> > - bool vet, int x, int y, bool unhap, int *e0,
> > int
> > *v,
> > - int bx, int by, int boatspeed, int needferry)
> <snip>
> > +static void process_attacker_want(struct player *pplayer, struct city
> > *pcity,
> > + int value, Unit_Type_id victim_unit_type,
> > + bool veteran, int x, int y, bool unhap,
> > + int *best_value, int *best_choice,
> > + int boatx, int boaty, int boatspeed,
> > + int needferry)
> > +{
>
> You really like long parameter lists don't you? I'm not sure this is an
> improvement on the original. It's absurdly long. I'll help you out by telling
> you how to get rid of boatspeed. In the short run, you can use
> unit_move_rate(punit) for a quick fix. In the long run, you can look at my
> patches for f_s_t_k and how I use unit_move_turns to fix the problem.
Out of scope of this patch. There's already a TODO.
> > +
> > + want = military_amortize(desire, MAX(1, move_time),
> > + bcost_balanced + needferry);
> > +
>
> Much better want equation. I'd want this patch to go into CVS for this reason
> alone.
:^)
--
Petr "Pasky" Baudis
* ELinks maintainer * IPv6 guy (XS26 co-coordinator)
* IRCnet operator * FreeCiv AI hacker
.
Teamwork is essential -- it allows you to blame someone else.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/
- [Freeciv-Dev] Re: [IAMBACK] [PATCH] [1.3] cleanup of proccess_*_want() (PR#1295), Petr Baudis, 2002/04/05
- [Freeciv-Dev] Re: [IAMBACK] [PATCH] [1.3] cleanup of proccess_*_want() (PR#1295), Raahul Kumar, 2002/04/06
- [Freeciv-Dev] Re: [IAMBACK] [PATCH] [1.3] cleanup of proccess_*_want() (PR#1295),
Petr Baudis <=
- [Freeciv-Dev] Re: [IAMBACK] [PATCH] [1.3] cleanup of proccess_*_want() (PR#1295), Gregory Berkolaiko, 2002/04/06
- [Freeciv-Dev] Re: [PATCH] [1.4] cleanup of proccess_*_want() (PR#1295), Petr Baudis, 2002/04/07
- [Freeciv-Dev] Re: [PATCH] [1.4] cleanup of proccess_*_want() (PR#1295), Raahul Kumar, 2002/04/07
- [Freeciv-Dev] Re: [PATCH] [1.5] cleanup of proccess_*_want() (PR#1295), Petr Baudis, 2002/04/08
|
|