Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: directional system: more magic code cleanups
Home

[Freeciv-Dev] Re: directional system: more magic code cleanups

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: directional system: more magic code cleanups
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 30 Sep 2001 18:46:52 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Sep 29, 2001 at 02:21:25AM -0400, Ross W. Wetmore wrote:
> Ok, here is a slight refinement of your proposal in pseudocode form. 
> 
> (It is disgusting how easily I can be sucked into an intriguing puzzle :-).
> 
> 0)  Fix straightest_dir() according to the current (exact) algorithm for 
>     determining a direction at a given point. It has nothing to do with 
>     lines and is useful for what it does, so you certainly don't want to 
>     (ab)use its signature.
> 
> 1)  Add a (pointer to) struct goto_block to the unit struct or wherever
>       int   count;               /* total count remaining     */

s/count/steps/ or s/count/num_steps/ ?!

> 2)  Define a new function straightest_line_init() like this
> 3)  Define a new function straightest_line_next() like this
> This is more like a LINE_STEP() algorithm, but I think that is what
> you were looking for.

Yes. Something like this.

> But as you can see, its semantics and use are really quite different
> from straightest_direction().

We don't need straightest_direction anymore.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "If at first you don't succeed... well so much for skydiving."


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