Background
I want to add an Office building for Corporations. These buildings are to be built in the normal way but will give you a CEO of the particular corporation to which the office is related. the plan is to add a tag OfficeCorporation, to the BuildingInfos.XML.
There is a tag, in CIV4CorporationInfo.xml, <FreeUnitClass> which is linked to the tag in
CIV4BuildingInfos.xml, <FoundsCorporation>, I want to change that to link it to the office, so that when an office is built you receive a free CEO. The unit while be set to Immobile but will establish the corporation in that city. In other words I want to change the method of in which to corporation is spread, from building a unit in a city which has the corporation to building a building in a city that does not, to spread it.
The Function
The Idea is that this function could be used to switch the free unit from the headquarters to the office. The headquarters is determined by foundscorporation, so I add OfficeCorporation and change Headquarters for Office in the function below?
Also what does GC.getGameINLINE mean? and are there parts of this function that I must keep, I just want the headquarters ability in giving free CEO's removed (all other functions of the headquarters are to remain the same.) Thanks for any help.
In CvCity.cpp
I want to add an Office building for Corporations. These buildings are to be built in the normal way but will give you a CEO of the particular corporation to which the office is related. the plan is to add a tag OfficeCorporation, to the BuildingInfos.XML.
There is a tag, in CIV4CorporationInfo.xml, <FreeUnitClass> which is linked to the tag in
CIV4BuildingInfos.xml, <FoundsCorporation>, I want to change that to link it to the office, so that when an office is built you receive a free CEO. The unit while be set to Immobile but will establish the corporation in that city. In other words I want to change the method of in which to corporation is spread, from building a unit in a city which has the corporation to building a building in a city that does not, to spread it.
The Function
The Idea is that this function could be used to switch the free unit from the headquarters to the office. The headquarters is determined by foundscorporation, so I add OfficeCorporation and change Headquarters for Office in the function below?
Also what does GC.getGameINLINE mean? and are there parts of this function that I must keep, I just want the headquarters ability in giving free CEO's removed (all other functions of the headquarters are to remain the same.) Thanks for any help.
In CvCity.cpp
Code:
bool CvCity::isHeadquarters(CorporationTypes eIndex) const
{
return (GC.getGameINLINE().getHeadquarters(eIndex) == this);
}
void CvCity::setHeadquarters(CorporationTypes eIndex)
{
GC.getGameINLINE().setHeadquarters(eIndex, this, true);
if (GC.getCorporationInfo(eIndex).getFreeUnitClass() != NO_UNITCLASS)
{
UnitTypes eFreeUnit = ((UnitTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getCorporationInfo(eIndex).getFreeUnitClass())));
if (eFreeUnit != NO_UNIT)
{
GET_PLAYER(getOwnerINLINE()).initUnit(eFreeUnit, getX_INLINE(), getY_INLINE());
}
}
}
bool CvCity::isHeadquarters() const
{
int iI;
for (iI = 0; iI < GC.getNumCorporationInfos(); iI++)
{
if (isHeadquarters((CorporationTypes)iI))
{
return true;
}
}
return false;
}