* 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. */
| 567 | * @param z Pointer to the Z coordinate. |
| 568 | */ |
| 569 | void 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 |