| 383 | } |
| 384 | |
| 385 | void TileContainer::setTileNeighbors(Tile *t) |
| 386 | { |
| 387 | for (unsigned int i = 0; i < 2; ++i) |
| 388 | { |
| 389 | int tempX = t->getX(), tempY = t->getY(); |
| 390 | switch (i) |
| 391 | { |
| 392 | case 0: |
| 393 | --tempX; |
| 394 | break; |
| 395 | case 1: |
| 396 | --tempY; |
| 397 | break; |
| 398 | |
| 399 | default: |
| 400 | OD_LOG_ERR("Unknown neighbor index=" + Helper::toString(i)); |
| 401 | continue; |
| 402 | } |
| 403 | |
| 404 | // If the current neigbor tile exists, add the current tile as one of its |
| 405 | // neighbors and add it as one of the current tile's neighbors. |
| 406 | if (tempX >= 0 && tempY >= 0) |
| 407 | { |
| 408 | Tile *tempTile = getTile(tempX, tempY); |
| 409 | tempTile->addNeighbor(t); |
| 410 | t->addNeighbor(tempTile); |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | void TileContainer::tileToPacket(ODPacket& packet, Tile* tile) const |
| 416 | { |
nothing calls this directly
no test coverage detected