On Tue, 24 Jan 2017 04:03:04 +0100 "Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net> wrote: > could any please give me some insight into the purpose of > FeatureContainer vs. similar functions (eg. hasAbility()) and > getAbilities()) in other objects (eg. Colony) ?
FeatureContainer is what the name implies, a container for Features (i.e. Ability and Modifier). Many classes do not need one, so we do not add it by default to FreeColObject. The classes that can use a simple container implement getFeatureContainer (e.g. Player). However some classes (e.g. Unit) are too complex for a simple container and override get{Abilities,Modifiers} which the other feature-related routines depend on. > Should we perhaps consolidate all the ability handling inside > FeatureContainer and let FreeColObject just call it ? I am not sure what you intend here that is different from the current implementation. Beware though that this is an area where it is easy to break things. Also, I have reviewed the first 50 or so of your patches. I do not understand your objection to Streams. Nearly all the patches removing Streams use bloat the code. Please do not do that *unless* you can demonstrate a real benefit, and I think you will have to look hard if you think that performance will significantly improved. I checked my test results, and over the period from mid-2015 to early 2016 when I added most of the Streams code, the average turn speed of my overnight tests (all-AI simulations with no waiting for interactive users) decreased by about 2%, which is within the bounds of error. This is obviously not definitive as a lot of other code went in at the same time, but certainly suggestive that Streams have negligible impact, and even if Streams are fully to blame for the change, I am *not* worried that it now takes 7 AI players 5.2s to move rather than 5.1s. Cheers, Mike Pope
pgp2ptTBbTwGk.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