[Freeciv-Dev] Re: DIRSTEP ?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, Nov 25, 2001 at 02:46:42AM +0000, Gaute B Strokkenes wrote:
> On Mon, 12 Nov 2001, hawk@xxxxxxxxxxxxxxxxxxxxxxx wrote:
> > On Mon, Nov 12, 2001 at 06:01:51PM +0000, Gaute B Strokkenes wrote:
> >> On Mon, 12 Nov 2001, hawk@xxxxxxxxxxxxxxxxxxxxxxx wrote:
> >> > On Sun, Nov 11, 2001 at 09:04:47PM +0000, Gaute B Strokkenes
> >> > wrote:
> >> >>
> >> >> Can someone remind me what this is supposed to do? AFAICT it
> >> >> only exists to obfuscate things.
> >> >
> >> > We don't want direct access of the DIR_D[XY] arrays.
> >>
> >> Why?
> >
> > Because we may change the implementation in the future. Mhh this
> > isn't a good reason.
>
> I do not see how DIRSTEP helps in that regard. Perhaps you can
> elaborate?
If we remove the DIR_D[XY] arrays we only have to change the DIRSTEP
and not the code. This isn't a good reasons because it is rather
unlikely that the DIR_D[XY] arrays go away.
> > In the current tree DIRSTEP is only used a few times. Which of these
> > instance bother you?
>
> All of them. DIRSTEP() adds verbiage and complexity where none is
> needed. It frequently necessitates the use of temporary variables,
> and the idiom of first loading a pair of offsets dx, dy into the
> destination and then adding the original values x, y is
> counterintuitive and confusing.
I agree that it isn't the most slick method. However 7 instances are
not worth the discussion IMHO.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
The trick is to keep breathing.
|
|