Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: Small patch to AI Manage functions
Home

[Freeciv-Dev] Re: Small patch to AI Manage functions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Zach Garner <zach@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Small patch to AI Manage functions
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Thu, 7 Feb 2002 20:24:20 +0000 (GMT)

 --- Zach Garner <zach@xxxxxxxxxxxxx> wrote: > > Mmm.  But still a unit
can do nothing with no moves.  Why bother
> calling
> > ai_manage_specific_type at all?
> 
> I guess its just my personal preference. To explain the way I think
> about it:  For functions like ai_manage_caravan, there are conditions
> which a unit needs to do something even though there are no moves left.
> If at a later time, military units do require some kind of processing,
> even though there are no moves left, I'd rather not have to modify the
> calling functions just to get it to work correctly. This is an
> encapsulation issue..

Sorry, I didn't look at the code.
I thought there is 
if (!punit->moves_left) return; /* can't do anything with no moves */
at the top of ai_manage_unit, before we go to 
if diplomat else if settler else...
thing.

But it is inside some of the statements!

Then you are right (btw it's your fault because if you did context diff I
would have understood you better).


> In ai_manage_caravan, the fist line of real code is:
>   if (punit->activity != ACTIVITY_IDLE) return;
> why not put this in ai_manage_unit as well as testing for moves_left?

I take it it's a rhetoric question? ;)

G.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


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