Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2002:
[freeciv-ai] Re: Time to enemy city/unit
Home

[freeciv-ai] Re: Time to enemy city/unit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: Time to enemy city/unit
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Wed, 25 Dec 2002 23:48:54 +0000 (GMT)

On Wed, 25 Dec 2002, Gregory Berkolaiko wrote:
> This is the first step in my quest for unification of the above three
> functions.

Into one function? Can you explain a little what this monster function
would look like? I'm especially concerned with the number of variables
passes to it...

> Will be committed quite soon unless there are objections.

The patch looks very good overall. Now prospective developers won't be
frightened with bedtime stories about the dreaded fstk anymore.

A few nitpicks, though:

+  if ( !(orig_move_type == SEA_MOVING || orig_move_type == LAND_MOVING) ) {
       ^                                                                ^
I'd prefer no spaces there. Also != SEA_MOVING && != LAND_MOVING is
better.

+    freelog(LOG_ERROR, "Attempting to deal with non-trivial move_type"
+            "in process_attacker_want");
+    return;

Add an assert, too, please.

+/***************************************************************************
+ * A rough estimate of time (measured in turns) to get to the enemy city,
+ * taking into account ferry transfer.
+ * If boat == NULL, we will build a boat of type boattype right here, so
+ * we wouldn't have to walk to it.
+ *
+ * Requires ready warmap(s).  Assumes punit is ground or sailing.
+ ***************************************************************************/

I prefer not having those '*' in front of the function headers comment,
and IIRC this is how most of the rest of the functions headers are as
well.

  - Per



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