Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2521) general effects framework
Home

[Freeciv-Dev] Re: (PR#2521) general effects framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2521) general effects framework
From: "Mike Kaufman via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 10 Dec 2002 11:33:48 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, Dec 10, 2002 at 12:44:55AM -0800, Raimar Falke via RT wrote:
> 
> The ideal solution is IMHO is there is an
>   bool is_pending(...);
> this function can either have the body
>   return eff->pending
> or
>   return (eff->has_nat && eff->has_gov && eff->has_adv
>           && eff->has_no_equiv && eff->has_eff)
> 
> If you abstract the access to it you can implement both alternatives
> and time them. As seen on the PF thread doubling the memory footprint
> can make the computation slow down by an factor of 2.
> 
> It should be obvious that is_pending should be an inline function or
> an macro.

hmm.

> I'm searching for an alternative. And yes I haven't understood
> everything yet.
> 
> It looks like this is indead a building-only thing. IMHO we should
> separate this from the effects. Only while both use a variable range
> which have non-disjoint value sets we shouldn't mix them. Also "Local"
> is rather pointless for equiv_range?!

I tend to agree with this. I've had to kludge some things in improvements.c
as a result. making an enum equiv_range might be a better deal,
unfortunately, however, we would need another set of access functions, etc.
It's not worth it, especially as each would decribe the exact same set of
ranges. I'll add some comments to make it clear who uses what.

> Why do typesafety only benefit assignments?

when does type-safety matter?

> I wrote non-sense. I mean: if the AI has been teched to understand the
> effects all correctly the AI should be able to play at the same level
> under all rulesets if only buildings.ruleset file is changed. If this
> is true it contradicts your "as smart as long as the default ruleset
> is used" from above. Or did you want to express the same?

You still write nonsense as far as I can tell, but I think you understand
the point at some level.



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