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: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Cleaning up gotohand.c
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Sep 2001 15:08:37 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Sep 18, 2001 at 01:28:41PM +0100, Gregory Berkolaiko wrote:
> To reduce the time taken by warmap generation and improve the quality of
> the warmap I am undertaking an effort to implement the suggestion given
> in the comment to really_generate_warmap
> http://www.freeciv.org/lxr/source/server/gotohand.c?v=cvs#L261
> 
> I would like to divide the warmap generation into several subfunctions
> which could be called in, say, ai_find_someplace_to_go
> 
>   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;
>   }
> 
> This might increase volume of the code, but will make it neater, for
> sure.

Can you describe what the methods in your small sample do? Especially
warmap_next_position.

> 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.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Are you saying that you actually used the Classpath Java AWT classes in 
  addition to the GTK peers and got them to display something?
  Wow.  That's way better than I did and I wrote the code!"
    -- Aaron M. Renn in the classpath mailing list


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