On Mon, 30 Jan 2017 17:49:40 +0100
"Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net> wrote:
> On 29.01.2017 00:05, Michael T. Pope wrote:
> > On Sat, 28 Jan 2017 17:26:46 +0100
> > "Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net> wrote:  
> >> I've seen that modifiers are sometimes collected in lists, sometimes in
> >> sets. Is there a special reason behind that ?  
> > 
> > Historical accident/inconsistency between developers.  
> 
> Ok. Seems that Set is used more often (especially in FeatureContainer),
> therefore duplicate modifiers (incl. all attributes eg. source) are
> not allowed.

I can not think of a case where exactly equal Modifiers can coexist.
Goods parties come close but would have different timing.  However FreeCol
has a history of surprising its developers with unexpected corner cases.

> Digging a bit further, it really seems the whole duplicity problem
> (perhaps even the need for the source attribute)

Source attributes probably started as a GUI feature.

> Looks like a good place for subtle and hard to find bugs (which actually
> hit me in a completely different area).

Correct.  It has been.

> Matches my observation. Should we then get rid of all sorting outside
> the GUI ?

No.  As I said, it is needed when the final value is calculated.

> Actually, there won't be any need for recalculation, as there wouldn't
> be any need for any caches (outside the operators themselves), which
> need to be maintained.

I do not understand what you are saying here.  AFAICT you were proposing
a type of compound modifier.  Many(most?) modifiers can change, at least
in the sense of being added and/or removed.  If its underlying modifiers
change, a compound modifier will need recalculation.  It is effectively a
cache.
 
> Let's take a little example: a colony's warehouse capacity.
> (see Colony::getGoodsCapacity().
>...

I take the point that we could stop shovelling features up from the
buildings to the colony, and indeed that would be cleaner.
The main virtue of the current scheme for warehouses is that at least now
they are expressible in the spec, rather than being hard coded.  IIRC when
that code was written we were careful to keep the change minimal due
to major reworking of the production system at the time.

> > Also the individual modifiers will still be needed for display purposes
> > so you will not be saving memory.  
> 
> Do we really need the individual modifiers, or just groups of them ?

If they can change, certainly you need them.  You definitely can *not*
break the listing of applicable modifiers feature.  The users want that
and demand accuracy.  I do not want to have to fix those bugs again.

Cheers,
Mike Pope

Attachment: pgpJIwpH1mS7S.pgp
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to