The following functions simply proxy MultiKeyMap's interface.
ApplyModifiers(propertyName, originalValue, ent)
Caching system in front of FetchModifiedProperty(), as calling that every time is quite slow. This recomputes lazily. Applies per-player modifiers before per-entity modifiers, so the latter take priority;
||Handle of a technology property (eg Attack/Ranged/Pierce) that was changed.|
||template/raw/before-modifiers value. Note that if this is supposed to be a number (i.e. you call add/multiply on it) You must make sure to pass a number and not a string (by using + if necessary)|
||ID of the target entity|
originalValue after the modifiers
Alternative version of ApplyModifiers, applies to templates instead of entities. Only needs to handle global modifiers.
originalValue after modifiers
originalValue after modifiers.
Inform entities that we have changed possibly all values affected by that property. It's not hugely efficient and would be nice to batch. Invalidate caches where relevant.
Handle modifiers when an entity changes owner. We do not retain the original modifiers for now.
For efficiency in InvalidateCache, keep playerEntitiesCached updated.