Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY]
Home

[Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY]

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY]
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jun 2004 21:21:51 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8959 >

rwetmore@xxxxxxxxxxxx wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8959 >
> 
> Found another way to iterate over the world to retrieve a subset of
> information I see. You really do love this anti-pattern or have a
> strong desire to write poor code into Freeciv.

For some subset of "the world", yes.

> But if you just coded in the efficient iterator core from any of the
> corecleanups, you could change one value to loop over every second
> element of the rotationally ordered adjacent array to get the cartesian
> iterators - or just copy the existing code.

No, that iterator form won't work since it doesn't allow us to change 
which directions are cardinal.

In a hex-tile topology every direction (all six) should be considered 
cardinal.  Actually "cardinal" is a bit of a misnomer.  Cardinal 
directions means NSEW directions, but this isn't helpful since we don't 
know if they are map, GUI, or natural directions.

All of the users use it to mean "a direction in which we share a border 
with the tile, rather than just a corner intersection".  For instance 
rivers only flow in "cardinal" directions; irrigation can only be run in 
"cardinal" directions, etc.

> Doubling the iteration time for cartesian loops is clearly not a great
> thing. And has been said, if you keep doubling execution times every
> code spot you find, your program will soon run twice as slow. Hey, is
> that not already the case?

It is a tradeoff against having three times as much code.

jason




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