After being stuck for almost a week, I finally came up with a solution to what I got stuck on. I renamed TRADE_IDEAS to TRADE_TECHS and then the compiler would point out any TRADE_IDEAS left in the code and I could change all of them in one go. Now I finally ended up with a decent progress again
I have decided to make perks and techs behave in a very similar way. Perks have become techs, which are bought with father points instead of YIELD_IDEAS, but otherwise they aim to behave the same way. This mean it will be possible to make a tech tree for perks as well as I just implemented full support for that in the DLL. I haven't added any diplomacy for perks and I don't plan to do so, at least not anytime soon.
I have been thinking of providing the ability to make civics block other civics, techs block techs and so on. CivicInfo has it in Develop, but I skipped that part in CivEffects because I lack a good design. The problem with the current design is that it will not allow say a trait to block a civic. I want the flexibility to ban Muslim trait from using a pope worship civic.
I'm thinking of handling all banning directly from CivEffects, but that is not without problems. What if a player has Civic A, then invents tech B, which bans A? What if perk C bans tech D, which is already invented? It is possible to reach a number of undefined conditions this way and it is kind of tricky to solve those.
One solution I'm considering is to allow CivEffects to ban any CivEffect, which can get banned. The solution to not reaching undefined combinations would then be to add asserts to the XML reading code. If the CivEffect can be turned on/off during the game, it can only ban CivEffects of the same type as it is itself. If it is set from game start (like traits), then it can ban any type. This way the code elsewhere will not have to consider legal combinations as by default they are all legal. The question is: have I overlooked something?
About banning of the same category. I plan to use readPass2 to set mutual banning. If civic A bans Civic B, then Civic B will automatically ban Civic A even if no bans have been set in B. This will ensure that it isn't possible to enable B and than A and have both at the same time just because B is missed in XML setup.