Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#2370) Path finding
Home

[Freeciv-Dev] Re: (PR#2370) Path finding

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#2370) Path finding
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Sun, 2 Mar 2003 13:11:58 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, Mar 02, 2003 at 11:04:51AM -0800, Gregory Berkolaiko wrote:
> 
> On Sun, 2 Mar 2003, Raimar Falke wrote:
> 
> > On Thu, Feb 27, 2003 at 01:51:34PM -0800, Gregory Berkolaiko wrote:
> > 
> > > + *      Ou est la toilette la plus proche?
> > 
> > I can guess what this means ;) But it would be better to formulate
> > this in English.
> 
> It's a quote, can't translate :)
> 
> > > + * B) the caller doesn't know the coordinates of the goal yet (but knows 
> > 
> > s/coordinates/map position/ also used on other places.
> 
> The reason I used coordinates is because map position is given meaning of 
> "position plus path distance and all other info" in our terminology.

This is a "pf position". coordinates is too general if we get others
like native, indexed and such stuff for the iso maps.

> > > +  enum direction8 dir_to_next_pos;       /* Unsed only in struct_path */
> > 
> > It should be set to an invalid value otherwise.
> 
> For debugging purposes only, otherwise why waste CPU?

It should be included for --enable-debug=some.

> > > +/* Iterates the map until it reaches (x, y).  Then fills the info
> > > + * about it into pos.  Returns FALSE if position is unreachable.
> > > + * Contents of pos in this case is not defined. */
> > > +bool pf_get_position(struct pf_map *pf_map, int x, int y,
> > > +              struct pf_position *pos);
> > 
> > We should write that it is a shortcut for 
> > 
> >   if(!pf_get_path(...)) return FALSE;
> >   *pos = pf_last_position(path);
> 
> I saw it, I disliked it vehemently and I deleted it.  You can think about
> it as a shortcut for whatever.  But don't mislead other people to believe
> that we are "saving the shortest path in the internal buffer" or any such
> rubbish.

It is not so much about shortcuts but to help people understand how
these two functions are related. Also you can remove the duplicate
description of the function if you explain the semantic this way.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 A life? Cool! Where can I download one?




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