[Freeciv-Dev] Re: Map coordinate cleanups.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [Freeciv-Dev] Re: Map coordinate cleanups., (continued)
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/18
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/18
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Gregory Berkolaiko, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Gregory Berkolaiko, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups.,
Ross W. Wetmore <=
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Jason Dorje Short, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Vasco Alexandre Da Silva Costa, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/17
|
|