#include <src/Ext/HouseType/Body.h>
List of all members.
Member Typedef Documentation
Member Function Documentation
int HouseTypeExt::PickRandomCountry |
( |
| ) |
[static] |
{
std::vector<int> vecLegible;
HouseTypeClass* pCountry;
for (int i = 0; i < HouseTypeClass::Array->Count; i++) {
pCountry = HouseTypeClass::Array->Items[i];
if (pCountry->Multiplay) {
if (HouseTypeExt::ExtData *pData = HouseTypeExt::ExtMap.Find(pCountry)) {
for (int k = 0; k < pData->RandomSelectionWeight; k++) {
vecLegible.push_back(i);
}
}
}
}
if (vecLegible.size() > 0) {
int pick = ScenarioClass::Instance->Random.RandomRanged(0,
vecLegible.size() - 1);
return vecLegible.at(pick);
} else {
Debug::FatalErrorAndExit("No countries eligible for random selection!");
}
return 0;
}
Member Data Documentation
The documentation for this class was generated from the following files: