Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2003:
[freeciv-ai] Re: (PR#3584) Renaming vulnerability/belligerence
Home

[freeciv-ai] Re: (PR#3584) Renaming vulnerability/belligerence

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [freeciv-ai] Re: (PR#3584) Renaming vulnerability/belligerence
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Fri, 2 May 2003 07:35:36 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Fri, 2 May 2003, Juhani Heino wrote:

> 
>  Renaming:
> > =========
> > 1. base_unit_belligerence_primitive
> >   -> unittype_att_rating
> > 2. unit_belligerence_basic
> >   -> unit_att_rating
> > 3. unit_belligerence_primitive
> >   -> unit_att_rating_now
> > 4. unit_belligerence
> >   -> unit_att_rating_sq
> 
> This part in the attachment.

Very good!

Few comments:

--- ai/advmilitary.c.orig       Fri May  2 01:42:07 2003
+++ ai/advmilitary.c    Fri May  2 01:32:26 2003
@@ -783,7 +783,7 @@
       /* See description of kill_desire() for info about this variables. */
       int bcost = unit_types[unit_type].build_cost;
       int vuln;
-      int attack = base_unit_belligerence_primitive(unit_type, will_be_veteran,
+      int attack = unittype_att_rating(unit_type, will_be_veteran,
                      SINGLE_MOVE, unit_types[unit_type].hp);

Please fix indentation, here and in one other place.


--- ai/aiunit.c.orig    Fri May  2 01:46:35 2003
+++ ai/aiunit.c Fri May  2 01:55:37 2003
@@ -810,7 +810,7 @@
 /**************************************************************************
 ...
 **************************************************************************/


Please write a comment before each function.


-int base_unit_belligerence_primitive(Unit_Type_id type, bool veteran,
+int unittype_att_rating(Unit_Type_id type, bool veteran,
                                     int moves_left, int hp)
 {
   return (base_get_attack_power(type, veteran, moves_left) * hp *
@@ -952,7 +952,7 @@
     unit_list_iterate(ptile->units, aunit) {
       if (aunit != punit
          && pplayers_allied(unit_owner(punit), unit_owner(aunit))) {
-        int val = (unit_belligerence_basic(aunit));
+        int val = (unit_att_rating(aunit));


Why are there brackets around the return value?  I know it wasn't 
introduced by you, but you can remove them all the same ;)


After that is done I believe I will just commit it unless I hear protests.

G.





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