Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: Cleaning up gotohand.c
Home

[Freeciv-Dev] Re: Cleaning up gotohand.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Cleaning up gotohand.c
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Thu, 20 Sep 2001 14:55:20 +0100 (BST)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Wed, Sep 19, 2001 at 11:52:57AM +0100, Gregory Berkolaiko wrote:
[..]
> > But the calculation like
> > 
> > generate_warmap
> > whole_map_iterate{
> >   evaluate_position(x,y); /* computes fitness */
> > }
> > 
> > is ugly and unneccessary.  For an example see ai_manage_explorer.
> 
> It is an optimization. Correct? If this is done I want a nice
> interface. You share some state over the function calls. This has to
> be explicit IMHO. Another way is to give the generate_warmap a
> callback which can return 1 to terminate the generating.

aye, optimization and beautyfication of the code.
hard to make the state explicit though.

callback is a great idea but
1. I have no experience with callbacks whatsoever.  It's never late to
start, but...
2. There need to be 2 callbacks: one for stopping the generation and one
for evaluating the tile.  Then a function like ai_manage_explorer will
need about 5 callbacks.  Can be quite complicated, don't you think?

G.


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie


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