OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
DiagonalTileArea Struct Reference

Represents a diagonal tile area. More...

`#include <tilearea_type.h>`

## Public Member Functions
| DiagonalTileArea (TileIndex tile=INVALID_TILE, int8 a=0, int8 b=0)
| Construct this tile area with some set values.
| DiagonalTileArea (TileIndex start, TileIndex end)
| Create a diagonal tile area from two corners.
void | Clear ()
| Clears the TileArea by making the tile invalid and setting a and b to 0.
bool | Contains (TileIndex tile) const
| Does this tile area contain a tile?

## Data Fields
TileIndex | tile
| Base tile of the area.
int16 | a
| Extent in diagonal "x" direction (may be negative to signify the area stretches to the left)
int16 | b
| Extent in diagonal "y" direction (may be negative to signify the area stretches upwards)

## Detailed Description

Represents a diagonal tile area.

Definition at line 64 of file tilearea_type.h.

## Constructor & Destructor Documentation

DiagonalTileArea::DiagonalTileArea | ( | TileIndex | tile = `INVALID_TILE`,
|  | int8 | a = `0`,
|  | int8 | b = `0`
| ) |  |
| inline

Construct this tile area with some set values.

Parameters

  tile | The base tile.
  a | The "x" extent.
  b | The "y" estent.

Definition at line 76 of file tilearea_type.h.

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

Create a diagonal tile area from two corners.

Parameters

  start | First corner of the area.
  end | Second corner of the area.

Definition at line 135 of file tilearea.cpp.

References a, b, MapSize(), TileX(), and TileY().

## Member Function Documentation

bool DiagonalTileArea::Contains | ( | TileIndex | tile | ) | const

Does this tile area contain a tile?

Parameters

  tile | Tile to test for.

Returns
  True if the tile is inside the area.

Definition at line 168 of file tilearea.cpp.

References a, b, TileX(), and TileY().

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

- src/tilearea_type.h
- src/tilearea.cpp