Complete.Org: Mailing Lists: Archives: freeciv-dev: February 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: Mon, 17 Feb 2003 09:21:48 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, Feb 17, 2003 at 09:01:04AM -0800, Gregory Berkolaiko wrote:
> 
> On Mon, 17 Feb 2003, Raimar Falke wrote:
> 
> > On Mon, Feb 17, 2003 at 04:59:19AM -0800, Gregory Berkolaiko wrote:
> > > 
> > > I remembered something that is really essential and that we forgot to put 
> > > it: 
> > > 
> > >   pf_get_position(map, pos, x, y)
> > > 
> > > This way we can query the map which is already made.
> > 
> > Do you mean
> > 
> >   pf_path tmp;
> > 
> >   pf_get_path(map, x, y, &tmp);
> >   foobar = pf_last_position(&path);

> Precisely, but without wasting time on lifting the whole path off
> the map.

*searching* yes there it is:

 "Premature optimization is the root of all evil."
    -- D. E. Knuth in "Structured Programming with go to Statements"

If you know the destination I don't think you are interrested in the
cost only (which would be a reason for use of pf_get_position). I
think you will be interrested in the path since you want to go to this
position.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I heard if you play the NT-4.0-CD backwards, you get a satanic message."
 "That's nothing, if you play it forward, it installs NT-4.0"




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