[Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Gregory Berkolaiko wrote:
From the first email:
Functions like find_the_shortest_paths use local warmap by default
(which renders it unrecyclable).
I don't see this.
What exactly is your question?
Nobody needs to know the internals of struct move_cost_map. You can
move this from gotohand.h to gotohand.c.
yes.
Only if you want to start passing around void* variables to refer to the
local move_cost_maps.
About the interface:
+void generate_warmap(struct move_cost_map *wm, int x, int y,
+ struct unit *punit);
+int get_warmap_land(struct move_cost_map *wm, int x, int y);
+int get_warmap_sea(struct move_cost_map *wm, int x, int y);
What do you think about:
struct move_cost_map *generate_warmap(int x, int y, struct unit
*punit, int use_global_warmap);
This way the access calls doesn't need to be changed if you use a
local warmap.
True. But I thought changing access calls is a good thing. At least for
testing: I suspect in few instances a wrong warmap is used.
You asked for incapsulation, didn't you?
I don't understand what Raimar is saying. Why will the current
interface Gregory has not be extensible? Just pass in a local warmap
instead of NULL, and it'll use that variable instead. Of course, you'll
have to initialize it separately - but that's probably a good thing; if
you have a warmap for each city you don't want to free and re-malloc
each time you generate a new one.
This patch looks to me like a step in the right direction. By
encapsulating accesses to the global warmap structure, it allows local
warmaps to be used later. The only problem is it's so long...
jason
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), (continued)
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/13
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/13
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Ross W. Wetmore, 2001/12/14
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/15
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/15
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/15
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/14
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/14
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/14
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/14
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108),
Jason Short <=
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/13
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/13
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/14
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/14
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/15
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/15
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/16
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/16
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Raimar Falke, 2001/12/16
- [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108), Gregory Berkolaiko, 2001/12/16
|
|