It would be very useful to be able to define multiple inheritance in config.cpp
That would highly reduce the size of config files.
It would also make the maintenance of them easier.
It would also open the doors to lighter and better mods.
It would be very useful to be able to define multiple inheritance in config.cpp
That would highly reduce the size of config files.
It would also make the maintenance of them easier.
It would also open the doors to lighter and better mods.
Simplified Example
CfgWeapons
{
class 556_Magazine { magazines[] = {"30rnd_556x45_EPR","30rnd_556x45_SOST"}; }; class add_special_pointer class WeaponSlotsInfo class PointerSlot: PointerSlot { compatibleItems[] += {"special_pointer"}; }; }; }; class modB_weapon_m4a1: modA_weapon_m4a1,556_Magazine{}; class modB_weapon_m16a4: modA_weapon_m16a4,556_Magazine,add_special_pointer{};
};
In this example I would create a new class using the base class from another mod and a new class I created to overwrite the magazines used by those weapons and also a second new class used to add the ability to use a special pointer for the m16a4.
The current way to do that is to rewrite the magazine property and the pointer property in every new class.
Which would work but if we have the same 20 properties to change in every weapon then it becomes a bit clumsy and complicated to maintain.
Isn't it the base of programming to never write the same code twice ?
I think that the Current Inheritance structure is unnecessarily complex to work with for a simple reason.
Every-time you want to redefine something on more than one level at the time you have to re-declare the whole tree of parent classes making sure not to mention one class twice...
Which makes it especially hard to do pragmatically or even manually if you have a lot of classes to redefine.
Since then they all at some point inherit from each other on multiple level and even sometime on the same level.
Multiple Inheritance would solve.
Being able to redefine inherited sub-properties without being forced to re-declare them would also solve that issue.
Oh and by the way, Bjarne Stroustrup implemented Mulitple Inheritance in C++ in 1984, So I guess that 30 years later Bohemia is probably able to do the same...