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

Method getTileCoords

src/Savegame/SavedBattleGame.cpp:569–574  ·  view source on GitHub ↗

* Converts a tile index to coordinates. * @param index The (unique) tileindex. * @param x Pointer to the X coordinate. * @param y Pointer to the Y coordinate. * @param z Pointer to the Z coordinate. */

Source from the content-addressed store, hash-verified

567 * @param z Pointer to the Z coordinate.
568 */
569void SavedBattleGame::getTileCoords(int index, int *x, int *y, int *z) const
570{
571 *z = index / (_mapsize_y * _mapsize_x);
572 *y = (index % (_mapsize_y * _mapsize_x)) / _mapsize_x;
573 *x = (index % (_mapsize_y * _mapsize_x)) % _mapsize_x;
574}
575
576/**
577 * Gets the currently selected unit

Callers 1

PathfindingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected