jkp1187
Unindicted Co-Conspirator
Hello, all. I need some help in understanding what the code below means.
Searching through CvPlayer.cpp, I see the following code from "canRevolution":
What I am attempting to do is write code for one of my random events that will check to see if a specific civic (say, CIVICOPTION_LEGAL/FREE_SPEECH,) is currently forced (by a UN vote, for instance). If a specific civic for the legal category is forced, return false, otherwise return true.
This code is a little daunting to me, as there are several things in here (like: "GC.getGameINLINE()", "iI", and "++iI") that I'd not seen before and did not see in the API. If someone could help me understand this better, I'd really appreciate it. The above code looks like it might be close to what I want to do, but I'm just unclear on what everything in it means.
Thanks!
Searching through CvPlayer.cpp, I see the following code from "canRevolution":
Code:
for (iI = 0; iI < GC.getNumCivicOptionInfos(); ++iI)
{
if (GC.getGameINLINE().isForceCivicOption((CivicOptionTypes)iI))
{
if (!GC.getGameINLINE().isForceCivic(paeNewCivics[iI]))
{
return false;
}
}
if (getCivics((CivicOptionTypes)iI) != paeNewCivics[iI])
{
return true;
}
}
}
return false;
What I am attempting to do is write code for one of my random events that will check to see if a specific civic (say, CIVICOPTION_LEGAL/FREE_SPEECH,) is currently forced (by a UN vote, for instance). If a specific civic for the legal category is forced, return false, otherwise return true.
This code is a little daunting to me, as there are several things in here (like: "GC.getGameINLINE()", "iI", and "++iI") that I'd not seen before and did not see in the API. If someone could help me understand this better, I'd really appreciate it. The above code looks like it might be close to what I want to do, but I'm just unclear on what everything in it means.
Thanks!