[Freeciv-Dev] Re: Cleaning up gotohand.c
[Top] [All Lists]
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
 --- 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
 
- [Freeciv-Dev] Cleaning up gotohand.c, Gregory Berkolaiko, 2001/09/18
- [Freeciv-Dev] Re: Cleaning up gotohand.c, Raimar Falke, 2001/09/18
- [Freeciv-Dev] Re: Cleaning up gotohand.c,
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: Cleaning up gotohand.c, Raimar Falke, 2001/09/19
 - [Freeciv-Dev] Re: Cleaning up gotohand.c, Gregory Berkolaiko, 2001/09/19
 - [Freeciv-Dev] Re: Cleaning up gotohand.c, Raimar Falke, 2001/09/19
 - [Freeciv-Dev] Re: Cleaning up gotohand.c, Gregory Berkolaiko, 2001/09/20
 - [Freeciv-Dev] Re: Cleaning up gotohand.c, Raimar Falke, 2001/09/20
 
  
  
  
 
 
 | 
 |