[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]
<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
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/11
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY],
Jason Short <=
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/13
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/13
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/20
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Gregory Berkolaiko, 2004/06/20
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/20
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/21
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Gregory Berkolaiko, 2004/06/22
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/22
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], Jason Short, 2004/06/22
- [Freeciv-Dev] Re: (PR#8959) remove CAR_DIR_D[XY], rwetmore@xxxxxxxxxxxx, 2004/06/23
|
|