* Does this tile area contain a tile? * @param tile Tile to test for. * @return True if the tile is inside the area. */
| 102 | * @return True if the tile is inside the area. |
| 103 | */ |
| 104 | bool OrthogonalTileArea::Contains(TileIndex tile) const |
| 105 | { |
| 106 | if (this->w == 0) return false; |
| 107 | |
| 108 | assert(this->w != 0 && this->h != 0); |
| 109 | |
| 110 | uint left = TileX(this->tile); |
| 111 | uint top = TileY(this->tile); |
| 112 | uint tile_x = TileX(tile); |
| 113 | uint tile_y = TileY(tile); |
| 114 | |
| 115 | return IsInsideBS(tile_x, left, this->w) && IsInsideBS(tile_y, top, this->h); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Expand a tile area by rad tiles in each direction, keeping within map bounds. |
no test coverage detected