Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [CMA 2.3] A few comments
Home

[Freeciv-Dev] Re: [CMA 2.3] A few comments

[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: [CMA 2.3] A few comments
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 9 Oct 2001 13:55:13 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Oct 09, 2001 at 03:46:16AM -0700, Raahul Kumar wrote:
> 
> --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > On Tue, Oct 09, 2001 at 02:26:13AM -0700, Raahul Kumar wrote:
> > > 
> > > #define MAX_CITY_SIZE                                     30
> > > 
> > > In Freeciv cities can reach city size 35. Make it 40 to be on the safe
> > side.
> > 
> > No problem.
> > 
> > > #define MAX_CMAS          (4*6+4)
> > > Order of precedence, I do not know whether C multiplies or adds first, in
> > maths
> > > multiplication is done first so result is ((4*6)+4)) = 28. Regardless, 
> > > just
> > add
> > > brackets to make intent clear.
> > 
> > C follows the maths way here. IMHO is/should be clear and no brackets
> > were needed.
> > 
> > > Why these numbers in particular multiplied
> > > together? Do they come from somewhere? Comments please.
> > 
> > NUM_STATS * 3 (for max. stat, +2 stat and max. stat with out gold
> > limit) + 6 (+1 food ... +6 food) + 4 (max all, save, max food+prod,
> > max food+prod+trade).
> > 
> 
> Please add your comment(above) to the CMA. 

I will.

> But it looks like there probably will never be a need to change it.

Don't be sure on this. Christian Knoke tested it and used another
setting in all cities. So if CMA is widely used we may add more
sensible preset parameters.

> > MAX_CMAS is an internal constant. Code from outside has to use
> > cmafc_predefined_num to get the number of predefined parameters.
> >
> 
> Why not just import header files? Is this for other languages like python etc?

Encapsulation. Data hiding.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  What's nice about GUI is that you see what you manipulate.
  What's bad about GUI is that you can only manipulate what you see.


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