Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: Yet More CMA
Home

[Freeciv-Dev] Re: Yet More CMA

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Yet More CMA
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 24 Sep 2001 15:13:44 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Sep 24, 2001 at 05:34:57AM -0700, Raahul Kumar wrote:
> This function is pointless. Why not just use player_in_city_radius?
>      
>      static int is_in_the_patch_of_a_city(int x,int y)
>      {
>          return player_in_city_radius(game.player_ptr,x,y);
> }

The has to do something with the programming. First I know I need a
certain method. I write the method name and the arguments. Then I try
to look through to code (ai,server,common,client) to find a method
which can be used. Summary: yes can be removed.

> The following code blocks pops up frequently in the CMA code. 
> Using some macro magic
> 
> #define CHECKTILE    if (x == 2 && y == 2)     \
>                                  continue      

No I cleaner way is to have a city_map_centerless_iterate.

>  The other two are left as an exercise for the reader.
>  
>  1)
>  
>  if (result->worker_positions_used[x][y]) {  
>       worker++;       
>                                     }

count_workers?

>  2)
>  
>  if (pcity->size !=
>              (worker + result->entertainers + result->scientists +            
>                  
>               result->taxmans)) {                                             
>                  
>            print_city(pcity);                                                 
>                  
>            print_cma_result(result);                                          
>                  
>            assert(0);                                                         
>                  
>  } 

Yes it occures often but I see no problem in this one.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Programming today is a race between software engineers striving to
  build bigger and better idiot-proof programs, and the Universe trying
  to produce bigger and better idiots. So far, the Universe is winning."
    -- Rich Cook


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