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

Method LoadFromINIFile

src/Ext/SWType/Body.cpp:64–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
65{
66 auto pThis = this->OwnerObject();
67 const char* pSection = pThis->ID;
68 INI_EX exINI(pINI);
69
70
71 // from ares
72 this->Money_Amount.Read(exINI, pSection, "Money.Amount");
73 this->SW_Inhibitors.Read(exINI, pSection, "SW.Inhibitors");
74 this->SW_AnyInhibitor.Read(exINI, pSection, "SW.AnyInhibitor");
75 this->SW_Designators.Read(exINI, pSection, "SW.Designators");
76 this->SW_AnyDesignator.Read(exINI, pSection, "SW.AnyDesignator");
77 this->SW_RangeMinimum.Read(exINI, pSection, "SW.RangeMinimum");
78 this->SW_RangeMaximum.Read(exINI, pSection, "SW.RangeMaximum");
79 this->SW_RequiredHouses = pINI->ReadHouseTypesList(pSection, "SW.RequiredHouses", this->SW_RequiredHouses);
80 this->SW_ForbiddenHouses = pINI->ReadHouseTypesList(pSection, "SW.ForbiddenHouses", this->SW_ForbiddenHouses);
81 this->SW_AuxBuildings.Read(exINI, pSection, "SW.AuxBuildings");
82 this->SW_NegBuildings.Read(exINI, pSection, "SW.NegBuildings");
83 this->SW_InitialReady.Read(exINI, pSection, "SW.InitialReady");
84 this->SW_PostDependent.Read(exINI, pSection, "SW.PostDependent");
85 this->SW_MaxCount.Read(exINI, pSection, "SW.MaxCount");
86 this->SW_Shots.Read(exINI, pSection, "SW.Shots");
87
88 this->UIDescription.Read(exINI, pSection, "UIDescription");
89 this->CameoPriority.Read(exINI, pSection, "CameoPriority");
90 this->LimboDelivery_Types.Read(exINI, pSection, "LimboDelivery.Types");
91 this->LimboDelivery_IDs.Read(exINI, pSection, "LimboDelivery.IDs");
92 this->LimboDelivery_RollChances.Read(exINI, pSection, "LimboDelivery.RollChances");
93 this->LimboKill_Affected.Read(exINI, pSection, "LimboKill.Affected");
94 this->LimboKill_IDs.Read(exINI, pSection, "LimboKill.IDs");
95 this->SW_Next.Read(exINI, pSection, "SW.Next");
96 this->SW_Next_RealLaunch.Read(exINI, pSection, "SW.Next.RealLaunch");
97 this->SW_Next_IgnoreInhibitors.Read(exINI, pSection, "SW.Next.IgnoreInhibitors");
98 this->SW_Next_IgnoreDesignators.Read(exINI, pSection, "SW.Next.IgnoreDesignators");
99 this->SW_Next_RollChances.Read(exINI, pSection, "SW.Next.RollChances");
100
101 this->ShowTimer_Priority.Read(exINI, pSection, "ShowTimer.Priority");
102
103 this->EMPulse_WeaponIndex.Read(exINI, pSection, "EMPulse.WeaponIndex");
104 this->EMPulse_SuspendOthers.Read(exINI, pSection, "EMPulse.SuspendOthers");
105 this->EMPulse_Cannons.Read(exINI, pSection, "EMPulse.Cannons");
106 this->EMPulse_TargetSelf.Read(exINI, pSection, "EMPulse.TargetSelf");
107
108 char tempBuffer[32];
109 // LimboDelivery.RandomWeights
110 for (size_t i = 0; ; ++i)
111 {
112 ValueableVector<int> weights;
113 _snprintf_s(tempBuffer, sizeof(tempBuffer), "LimboDelivery.RandomWeights%d", i);
114 weights.Read(exINI, pSection, tempBuffer);
115
116 if (!weights.size())
117 break;
118
119 if (this->LimboDelivery_RandomWeightsData.size() > i)
120 this->LimboDelivery_RandomWeightsData[i] = std::move(weights);
121 else

Callers

nothing calls this directly

Calls 2

ReadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected