Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[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]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2521) general effects framework
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 21 Apr 2004 08:44:54 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=2521 >

Vasco Alexandre da Silva Costa wrote:

>>That's not to say that only Enable_Nuke and Enable_Space do not have this
>>problem. Any_Government, Have_Embassies, No_Anarchy, No_Sink_Deep, and a
>>couple of other effects whose parameters are totally ignored can be used
>>this way. Using such a bitvector though means that savegames might be
>>corrupted if the order of enum effect_type_id changes. Better would be to
>>save a list of the effects names that survive in the savegame and using
>>effect_type_from_str() to look up the effect. Hmm. I don't know if there's
>>much point. comments?
> 
> 
> The problem is that adding struct fields is not easily extensible. If I
> want to add a new field I need to add those fields, init them somewhere,
> change the ruleset and game load/save routines, etc. While if this
> was done in a bitvector, or some other array, list or set structure easy
> to extend, there would be no such problem.

My suggestion was that enable_space and enable_nuke - both of which 
allow production of something based on a certain flag - can be merged 
into one effect.

So for Manhatten it would be

   Effect = ProvidesFlag
    extra data: survives
    extra data: flag name "CanNuke"

and for nukes

   Effect = RequiresFlag
     extra data: flag name "CanNuke"

it is then trivial to make the list of such "flags" into a bitvector.

jason




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