MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / GetRetail

Method GetRetail

Source/Versions.cpp:122–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120};
121
122const sGameVersion* cVersions::GetRetail(const ePlatform pPlatform, const eGame pGame) const {
123
124 auto Available = g_ResourceMan->GetAvailable();
125
126 auto RetailRelease =
127 std::find_if(Available.begin(), Available.end(),
128 [pPlatform, pGame](const sGameVersion* a)->bool { return a->mRelease == eRelease::Retail && a->mGame == pGame &&
129 (pPlatform == ePlatform::Any || a->mPlatform == pPlatform); });
130
131 // If we didnt find the platform, revert to any
132 if (RetailRelease == Available.end()) {
133
134 RetailRelease = std::find_if(Available.begin(), Available.end(),
135 [](const sGameVersion* a)->bool { return a->mRelease == eRelease::Retail; });
136
137 if (RetailRelease == Available.end())
138 return 0;
139 }
140
141 return *RetailRelease;
142}
143
144const sGameVersion* cVersions::GetDemo() const {
145 auto Available = g_ResourceMan->GetAvailable();

Callers 6

getDataPathMethod · 0.80
getDataFilePathMethod · 0.80
AboutMethod · 0.80
CreateRandomMethod · 0.80
StartMethod · 0.80
quickServiceScreenFunction · 0.80

Calls 3

GetAvailableMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected