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: Tue, 18 Sep 2001 22:49:39 +0100 (BST)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Tue, Sep 18, 2001 at 01:28:41PM +0100, Gregory Berkolaiko wrote:
> > 
> >   warmap_initialize(...);
> >   while (warmap_next_position(&x, &y)) {
> >     ...
> >     if (evaluate_position(x,y)) 
> >       warmap_process_position(x,y);
> >     if (found_someplace_to_go(x,y))
> >       break;
> >   }
> 
> Can you describe what the methods in your small sample do? Especially
> warmap_next_position.

Very briefly (since I do not have the methods yet):
warmap_next_position(&x, &y) returns locations in order of increasing
distance from origin.  it's a wraper for get_from_queue actually.

evaluate_position is whatever you wish to put there (like
is_coastline(x,y) -- useful for triremes)
found_someplace_to_go(x,y) is the same.

warmap_process_position(x,y) does the main thing of the warmap
generation: looks around x,y for places to go next, stuffs them into the
queue etc.

> > But this is the aim.  For now I am proposing a verrrrry small patch. 
> > Just some surface cleaning.  The function init_gotomap just calls
> > init_warmap and thus is unnecessary.
> 
> Looks sane to me.

Feel free to apply it ;)

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]