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

[Freeciv-Dev] Cleaning up gotohand.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Cleaning up gotohand.c
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Tue, 18 Sep 2001 13:28:41 +0100 (BST)

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.

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.

Tested: the savegames of the test runs are identical to current CVS'.

Best,
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

Attachment: remove_init_gotomap.diff
Description: remove_init_gotomap.diff


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