[Freeciv-Dev] Re: (PR#2370) Path finding
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
New version of PF attached. A couple of bugs fixed in path_finding.c
changes in pf_tools.[ch] and corresponding changes to Per's code in
aidiplomat.c
G.
Raimar, scroll for a comment on your comment.
On Wed, 19 Feb 2003, Raimar Falke wrote:
> > > > mind you, caching can still be done through void *data parameter.
> > > > We can pass pointer to caching map.
> > >
> > > Can you explain more?
> >
> > we make
> > struct cached_values {
> > int is_initialized;
> > int known;
> > int zoc_number;
> > int behavior;
> > }
> >
> > then
> > struct last_arg {
> > struct player *owner;
> > struct cached_values *vals;
> > } cache;
> >
> > and then do (at fill_parameter time)
> >
> > cache.vals = fc_calloc(...)
> >
> > get_BMC_data = &cache;
> > get_ECOT_data = &cache;
> >
> > then inside, say, get_BMC, we do
> >
> > if (!data->vals[index].is_init) {
> > data->vals[index].known = is_known_tile(x, y, owner);
> > // .....
> > }
> >
> > if (data->vals[index].known == TILE_UNKNOW) {
> > return 0;
> > }
> >
> > Almost the same as we have now, just done in callbacks themselves.
>
> And what if a user want to cache the is-coastal state? If we limit
> this to the above mentioned fields we can do in common code.
The user does all of the above, if he wants. So he can add whatever
fields he likes. Does it answer your comment? If not, I didn't
understand it...
G.
pf22.diff.gz
Description: GNU Zip compressed data
- [Freeciv-Dev] Re: (PR#2370) Path finding, (continued)
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/19
- [Freeciv-Dev] latest aidiplomat.c changes, Per I. Mathisen, 2003/02/19
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/19
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/19
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/19
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/19
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/19
- [Freeciv-Dev] Re: (PR#2370) Path finding,
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/19
- Message not available
- [Freeciv-Dev] Re: (PR#2370) Path finding, Jason Short, 2003/02/19
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/20
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/20
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/21
- [Freeciv-Dev] Offtopic: Re: Re: (PR#2370) Path finding, Andreas Røsdal, 2003/02/21
- [Freeciv-Dev] Re: Offtopic: Re: Re: (PR#2370) Path finding, Raimar Falke, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/21
|
|