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

[Freeciv-Dev] Re: the directional system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: the directional system
From: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Date: Mon, 10 Sep 2001 06:06:45 -0400
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

Raimar Falke wrote:

> In a lot of place we removed dependencies on the direction system. I'm
> sure we will also solve this DIR_DX2 case. So we have code base which
> is independent of the direction system. You than suggest we should
> loose this flexibility because two methods can be expressed in a
> simpler way. This will only happen if these method are moved to map.h
> (or a new dir.h) and surrounded by a big fat comment telling that
> these methods depend on a certain system. I would may be also add
> extra runtime checks like "assert(DIR_DX[0])==0;..." to ensure that
> the system will not change under our feets. But even then I'm not sure
> if I would make these changes. dir_ok and straightest_direction can be
> expressed in a way that is independent of the direction
> system. However if you show a performance improvement of some amount
> you may convince me. Thinking about this a bit more: the only current
> code which should be treated in the way above mentioned (fat warning,
> extra checks) is DIR_REVERSE.

What Ross is suggesting is not that all of dir_ok and
straightest_direction be moved into the map.h schema-dependent code.  We
are suggesting that additional macros such as DIR_NEXT and DIR_PREV be
created.  Of course, under the rotational system these are far easier to
write (and, more importantly, maintain) than they are under the vertical
system.  Any other macros that are similarly needed will likely have
similar properties.

Personally, I don't care much about small inefficiencies in the code and
it's not up to me to maintain it.  It's obvious to me that the
rotational system is better, but I'm confident that once we've converted
all code to be schema-independent it is just a matter of time until a
conversion to a better directional system is done.

Or, as I said before: the rotational system is without doubt better than
the vertical system.  The only reason for not converting to the better
system is that you don't think these differences are worth the time
necessary to convert.

jason


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