# TileArea Struct Reference

Represents the covered area of e.g. More...

`#include <tilearea_type.h>`

Inheritance diagram for TileArea:

## Public Member Functions
| TileArea ()
| Just construct this tile area.
| TileArea (TileIndex tile, uint8 w, uint8 h)
| Construct this tile area with some set values.
| TileArea (TileIndex start, TileIndex end)
| Construct this tile area based on two points.
void | Add (TileIndex to_add)
| Add a single tile to a tile area; enlarge if needed.
void | Clear ()
| Clears the 'tile area', i.e.
bool | Intersects (const TileArea &ta) const
| Does this tile area intersect with another?
## Data Fields
TileIndex | tile
| The base tile of the area.
uint8 | w
| The width of the area.
uint8 | h
| The height of the area.

## Detailed Description

Represents the covered area of e.g.

a rail station

Definition at line 18 of file tilearea_type.h.

## Constructor & Destructor Documentation

TileArea::TileArea | ( | TileIndex | tile,
|  | uint8 | w,
|  | uint8 | h |
| ) |  |  | `[inline]`

Construct this tile area with some set values.

Parameters:

  | tile | the base tile
  | w | the width
  | h | the height

Definition at line 28 of file tilearea_type.h.

TileArea::TileArea | ( | TileIndex | start,
|  | TileIndex | end |
| ) |  |  |

Construct this tile area based on two points.

Parameters:

  | start | the start of the area
  | end | the end of the area

Definition at line 501 of file station.cpp.

References Swap(), TileX(), TileXY(), and TileY().

## Member Function Documentation

void TileArea::Add | ( | TileIndex | to_add | ) |

Add a single tile to a tile area; enlarge if needed.

Parameters:

  | to_add | The tile to add

Definition at line 516 of file station.cpp.

References INVALID_TILE, max(), min(), TileX(), TileXY(), and TileY().

Referenced by CmdBuildRoadStop(), and RemoveRoadStop().

void TileArea::Clear | ( |  | ) | `[inline]`

Clears the 'tile area', i.e.

make the tile invalid.

Definition at line 50 of file tilearea_type.h.

References h, INVALID_TILE, tile, and w.

Referenced by RemoveRoadStop().

bool TileArea::Intersects | ( | const TileArea & | ta | ) | const

Does this tile area intersect with another?

Parameters:

  | ta | the other tile area to check against.

Returns:
  true if they intersect.

Definition at line 543 of file station.cpp.

References h, tile, TileX(), TileY(), and w.

Referenced by GetProductionAroundTiles().

The documentation for this struct was generated from the following files:

- src/tilearea_type.h
- src/station.cpp