[Freeciv-Dev] Re: the directional system
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sunday 09 September 2001 10:08, Raimar Falke wrote:
> > The DIR_DX2 system, by the way, was recently introduced to FreeCiv
> > by (IIRC) Thue. But, he didn't get very far in converting FreeCiv
> > over to its use: it's only used in one place.
>
> Exactly. And even at this one place it provides no advantage. Thue?
>
> Raimar
The advantages of the DIR_D[XY] arrays is:
-It is easy to find the opposite direction as (7-dir). This is the
DIR_REVERSE macro.
The first 3 directions are above the center, and the last 3 are below.
So you could potentially optimize an iteration. (I don't know if this
is used.)
Most uses of iterations don't case which of the adjacent tiles it uses,
it just needs to be fed them all one at a time, so the unintuitive
sequence doesn't do any harm there. (The fact that DIR_D[XY]2 is only
used one place seems to support this argument)
The DIR_D[XY]2 was used that place because we actually needed to map
array indices to their direction. Using the new "enum direction8" with
DIR_D[XY] would be a cleaner solution here, and allow you to remove
DIR_D[XY]2.
-Thue
- [Freeciv-Dev] Re: the directional system, (continued)
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/07
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/08
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system,
Thue <=
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/12
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/12
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/12
|
|