Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Map coordinate cleanups.
Home

[Freeciv-Dev] Re: Map coordinate cleanups.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Map coordinate cleanups.
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Sun, 19 Aug 2001 13:15:04 -0400

As Gregory pointed out the first solution involves redundant checks
since normalize_map_pos does an implicit is_real_position and returns
the appropriate status.

The third is the best and the one commonly implemented in the macros
and elsewhere, except for the assert(is_real_tile)/normalize_map_pos
cases that were recently added to take normalize out of assertions.

Cheers,
RossW
=====

At 04:51 PM 01/08/19 +0200, Raimar Falke wrote:
>On Sun, Aug 19, 2001 at 02:27:42PM +0100, Gregory Berkolaiko wrote:
>>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
>> > normalized positions? For the remaining 5% I don't care if the code
>> > is:
>> > 
>> >    x1=x+dx;
>> >    y1=y+dy;
>> >    if(!is_real_position(x1,y1))
>> >       continue;
>> >    normalize_position(&x1,&y1);
>> >    return (x1 and y1);
>> > 
>> > or
>> > 
>> >    x1=x+dx;
>> >    y1=y+dy;
>> >    normalize_position(&x1,&y1);
>> >    if(!is_real_position(x1,y1))
>> >       continue;
>> >    return (x1 and y1);
>> > 
>> > The first one looks better from a performance point of view.
>> 
>> Actually I vote for
>> 
>>     x1=x+dx;
>>     y1=y+dy;
>>     if(!normalize_position(x1,y1))
>>        continue;
>>     return (x1 and y1);
>> 
>> since normalize returns a very useful value.
>
>IMHO the first solution is the cleanest. However as I said, _I_ don't
>care about the 5% which uses such methods.
>
>> Anyway, Raimar, what is this thing "AI client" that Ross mentioned
>> you were writing?
>
>I have mail.
>
>       Raimar
>-- 
> email: rf13@xxxxxxxxxxxxxxxxx




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