Ok, so you'll have to loop by calling for the tech's getNumPrereqBuildingClasses(). I'm not sure how you'd set it up in python exactly but it looks, again, like this in C++:
for (iI=0; iI < GC.getTechInfo(eTech).getNumPrereqBuildingClasses(); iI++)
{
I'm exposing getNumPrereqBuildingClasses so you can define the loop count and use it to call to the following new functions:
int getPrereqBuildingClassType(int iIndex);
int getPrereqBuildingClassMinimumRequired(int iIndex);
so continuing syntax use in the DLL as an example:
Code:
int iRequired = 0;
for (iI=0; iI < GC.getTechInfo(eTech).getNumPrereqBuildingClasses(); iI++)
{
if (GC.getTechInfo(eTech).getPrereqBuildingClassType(iI) != -1)
{
BuildingClassTypes eBuildingClass = (BuildingClassType)GC.getTechInfo(eTech).getPrereqBuildingClassType(iI);
iRequired = GC.getTechInfo(eTech).getPrereqBuildingClassMinimumRequired(iI);
//Then do whatever you're going to do with it.
}
}
Hopefully you're code bi-lingual enough to sort that out. From previous comments, I think you are.
aka when the tech's getNum index number is handed off to the parameter of getPrereqBuildingClassType, you will get a return of the buildingclass index # in that slot. And when you hand it off to the parameter of getPrereqBuildingClassMinimumRequired, you'll get the minimum amount of those buildings that must be built to enable the tech.
This works the same with these tags as well:
int getNumPrereqOrBuildingClasses() const;
int getPrereqOrBuildingClassType(int iIndex);
int getPrereqOrBuildingClassMinimumRequired(int iIndex);
The new tags are purely for reporting to python for you to convert to a simpler method. It was surprisingly easy to do this - I was just overthinking things and letting my lack of comfort in this area confound my mind until I thought on it in the background for a while. I've been stuck on xml and spreadsheeting for so long that I'm starting to get a little rusty minded on coding already.
This should be on the SVN in an hour or so once compiling is complete.