1
0
forked from 0ad/0ad
0ad/source
wraitii e16c4c4800 Add a system component to handle stat modifiers, make technologies and auras use this common interface.
The ModifiersManager system component provides an interface to add and
remove modifiers, and get modified stats.
The goal is to merge all the different stat-modifying systems 0 A.D. has
implemented over the years.
This commit makes technologies and auras use ModifiersManager. Some
cheats and AI bonuses also have a similar stat-modifying effect that
have not yet been updated.

Further, this system component makes it possible for e.g. triggers to
easily add modifiers, enabling the writing of Castle Blood Automatic,
RPG or Tower Defense maps without the need for mods or hacks.

The 'Modifier' name was preferred over 'Modification' as it is shorter
and more readable, along with the logic that 'modifiers' store
'modifications' and this stores modifiers. Renaming of other functions
and classes has been left for future work for now.

Internally, this uses a JS data structure. If performance issues arise
with it in the future, this data structure or the whole component could
be moved to C++.
The performance has been tested to be about as fast as the current
implementations (and specifically much faster for global auras with no
icons). Testing showed that sending value modification messages was by
far the slowest part.

Comments by: leper, Stan, elexis
Differential Revision: https://code.wildfiregames.com/D274
This was SVN commit r22767.
2019-08-24 07:37:07 +00:00
..
collada Fix compiler warnings on VS 2015, refs #3439, refs #5069. 2018-03-10 09:58:53 +00:00
graphics Cleanup Camera and CGameView, removes a not needed method and refactors classes. 2019-08-22 20:49:58 +00:00
gui Replace copy-assigning GUI<T>::GetSetting from c2a71e41bf with the reference returning GetSetting from 3dfa23cd25. 2019-08-23 14:43:10 +00:00
i18n Simple refactoring of Singleton. Make it non-copyable. 2019-01-13 15:11:40 +00:00
lib pthread -> std::thread (4/7) - Replace pthread in remaining files 2019-08-15 09:07:16 +00:00
lobby Fix unused glooxwrapper variable following 61261d14fc, refs #2305, #5294, #5550. 2019-08-23 12:04:20 +00:00
maths Cleanups BoundingBoxAxisAligned and fixes coding styles a bit. 2019-06-12 20:23:14 +00:00
mocks More FreeBSD build fixes. 2012-01-30 06:21:11 +00:00
network Fix unreported glooxwrapper leaks following 61261d14fc, refs #2305. 2019-08-17 00:12:19 +00:00
pch Update precompiled headers to improve build times. 2019-05-26 07:21:12 +00:00
ps Fix unreported glooxwrapper leaks following 61261d14fc, refs #2305. 2019-08-17 00:12:19 +00:00
renderer Moves and cleanups includes and public/private section of PostprocManager. 2019-08-20 21:15:15 +00:00
scriptinterface Improve performance of ScriptInterface::CreateObject from b4626359f5 / D2080 by creating the JSAutoRequest struct only once instead of once per property. 2019-08-17 03:30:07 +00:00
simulation2 Add a system component to handle stat modifiers, make technologies and auras use this common interface. 2019-08-24 07:37:07 +00:00
soundmanager pthread -> std::thread (3/7) - Replace pthread in other engine files 2019-08-12 08:16:28 +00:00
third_party Removes deprecated 'register' storage class from mongoose. Refs #3068 2019-07-18 06:28:51 +00:00
tools Cleanup Camera and CGameView, removes a not needed method and refactors classes. 2019-08-22 20:49:58 +00:00
main.cpp Alt+tab fix for ca9109be75 - call sound IdleTask in Atlas and swap buffers only once in Atlas. 2019-07-24 16:40:34 +00:00
test_setup.cpp Fix string format of the JS test assertion failure following 7c2e9027c2 (cxxtest expects a char* instead of a std::wstring, so newlines were printed as \n characters). 2017-10-13 21:56:45 +00:00