MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / LoadFromINIFile

Method LoadFromINIFile

src/Ext/BuildingType/Body.cpp:107–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105// load / save
106
107void BuildingTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
108{
109 auto pThis = this->OwnerObject();
110 const char* pSection = pThis->ID;
111 const char* pArtSection = pThis->ImageFile;
112 auto pArtINI = &CCINIClass::INI_Art;
113 INI_EX exINI(pINI);
114 INI_EX exArtINI(pArtINI);
115
116 this->PowersUp_Owner.Read(exINI, pSection, "PowersUp.Owner");
117 this->PowersUp_Buildings.Read(exINI, pSection, "PowersUp.Buildings");
118 this->PowerPlantEnhancer_Buildings.Read(exINI, pSection, "PowerPlantEnhancer.PowerPlants");
119 this->PowerPlantEnhancer_Amount.Read(exINI, pSection, "PowerPlantEnhancer.Amount");
120 this->PowerPlantEnhancer_Factor.Read(exINI, pSection, "PowerPlantEnhancer.Factor");
121 this->Powered_KillSpawns.Read(exINI, pSection, "Powered.KillSpawns");
122
123 if (pThis->PowersUpBuilding[0] == NULL && this->PowersUp_Buildings.size() > 0)
124 strcpy_s(pThis->PowersUpBuilding, this->PowersUp_Buildings[0]->ID);
125
126 this->AllowAirstrike.Read(exINI, pSection, "AllowAirstrike");
127 this->CanC4_AllowZeroDamage.Read(exINI, pSection, "CanC4.AllowZeroDamage");
128
129 this->InitialStrength_Cloning.Read(exINI, pSection, "InitialStrength.Cloning");
130 this->ExcludeFromMultipleFactoryBonus.Read(exINI, pSection, "ExcludeFromMultipleFactoryBonus");
131
132 this->Grinding_AllowAllies.Read(exINI, pSection, "Grinding.AllowAllies");
133 this->Grinding_AllowOwner.Read(exINI, pSection, "Grinding.AllowOwner");
134 this->Grinding_AllowTypes.Read(exINI, pSection, "Grinding.AllowTypes");
135 this->Grinding_DisallowTypes.Read(exINI, pSection, "Grinding.DisallowTypes");
136 this->Grinding_Sound.Read(exINI, pSection, "Grinding.Sound");
137 this->Grinding_PlayDieSound.Read(exINI, pSection, "Grinding.PlayDieSound");
138 this->Grinding_Weapon.Read<true>(exINI, pSection, "Grinding.Weapon");
139 this->Grinding_Weapon_RequiredCredits.Read(exINI, pSection, "Grinding.Weapon.RequiredCredits");
140
141 this->DisplayIncome.Read(exINI, pSection, "DisplayIncome");
142 this->DisplayIncome_Houses.Read(exINI, pSection, "DisplayIncome.Houses");
143 this->DisplayIncome_Offset.Read(exINI, pSection, "DisplayIncome.Offset");
144
145 this->ConsideredVehicle.Read(exINI, pSection, "ConsideredVehicle");
146 this->SellBuildupLength.Read(exINI, pSection, "SellBuildupLength");
147 this->IsDestroyableObstacle.Read(exINI, pSection, "IsDestroyableObstacle");
148
149 this->FactoryPlant_AllowTypes.Read(exINI, pSection, "FactoryPlant.AllowTypes");
150 this->FactoryPlant_DisallowTypes.Read(exINI, pSection, "FactoryPlant.DisallowTypes");
151
152 this->Units_RepairRate.Read(exINI, pSection, "Units.RepairRate");
153 this->Units_RepairStep.Read(exINI, pSection, "Units.RepairStep");
154 this->Units_RepairPercent.Read(exINI, pSection, "Units.RepairPercent");
155 this->Units_UseRepairCost.Read(exINI, pSection, "Units.UseRepairCost");
156
157 this->NoBuildAreaOnBuildup.Read(exINI, pSection, "NoBuildAreaOnBuildup");
158 this->Adjacent_Allowed.Read(exINI, pSection, "Adjacent.Allowed");
159 this->Adjacent_Disallowed.Read(exINI, pSection, "Adjacent.Disallowed");
160
161 if (pThis->NumberOfDocks > 0)
162 {
163 std::optional<DirType> empty;
164 this->AircraftDockingDirs.resize(pThis->NumberOfDocks, empty);

Callers

nothing calls this directly

Calls 6

issetMethod · 0.80
ReadMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45
clearMethod · 0.45
LoadFromINIMethod · 0.45

Tested by

no test coverage detected