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

Method getTileIndex

src/Savegame/SavedBattleGame.h:126–129  ·  view source on GitHub ↗

* Converts coordinates into a unique index. * getTile() calls this every time, so should be inlined along with it. * @param pos The position to convert. * @return A unique index. */

Source from the content-addressed store, hash-verified

124 * @return A unique index.
125 */
126 inline int getTileIndex(const Position& pos) const
127 {
128 return pos.z * _mapsize_y * _mapsize_x + pos.y * _mapsize_x + pos.x;
129 }
130
131 /// Converts a tile index to its coordinates.
132 void getTileCoords(int index, int *x, int *y, int *z) const;

Callers 7

setupAmbushMethod · 0.80
setupEscapeMethod · 0.80
selectPointNearTargetMethod · 0.80
findFirePointMethod · 0.80
getNodeMethod · 0.80
findReachableMethod · 0.80
setupEscapeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected