MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getMapData

Method getMapData

src/Ruleset/RuleTerrain.cpp:171–187  ·  view source on GitHub ↗

* Gets a mapdata object. * @param id The id in the terrain. * @param mapDataSetID The id of the map data set. * @return Pointer to MapData object. */

Source from the content-addressed store, hash-verified

169 * @return Pointer to MapData object.
170 */
171MapData *RuleTerrain::getMapData(int *id, int *mapDataSetID) const
172{
173 MapDataSet* mdf = 0;
174
175 for (std::vector<MapDataSet*>::const_iterator i = _mapDataSets.begin(); i != _mapDataSets.end(); ++i)
176 {
177 mdf = *i;
178 if (*id < mdf->getSize())
179 {
180 break;
181 }
182 *id -= mdf->getSize();
183 (*mapDataSetID)++;
184 }
185
186 return mdf->getObjects()->at(*id);
187}
188
189/**
190 * Gets the maximum amount of large blocks in this terrain.

Callers

nothing calls this directly

Calls 2

getObjectsMethod · 0.80
getSizeMethod · 0.45

Tested by

no test coverage detected