Closed yeerkkiller1 closed 11 years ago
It seems like it is inefficient how we apply alleles, but unfortunately this has to be done or else we can't insure a consistent allele application order.
Should be done, may be bugs but not anything I can find right away.
Allele interface will become like this:
An allele is made up of a group and a delta. Only one allele from each group may be present in a tower or bug or anything at one time. The delta is applied simply by: a) Adding the number of any property in the delta to the property of the same name in the object attrs b) Instantiating and then adding anything with a name of "attack" to the attack_types c) Setting the target strategy to anything with a name of "target".
When an allele is added any allele in the same group is removed, the attrs of the entity is reset by calling "setBaseAttrs" and then all the alleles are reapplied (right now in no particular order, but in the future they will be applied anything which added/subtracts, then multiplication/division, etc).
If applying a lot of alleles you can call startAlleleAdd before you add the alleles and then endAlleleAdd afterwards, causing the alleles to be applied only once (instead of applied and reapplied for every allele you add).