OpenTTD Source: src/depot_map.h File Reference

OpenTTD Source 13.2.1

Functions
depot_map.h File Reference
`#include "station_map.h"`

Go to the source code of this file.

## Functions
static bool | IsDepotTypeTile (TileIndex tile, TransportType type)
| Check if a tile is a depot and it is a depot of the given type.
static bool | IsDepotTile (TileIndex tile)
| Is the given tile a tile with a depot on it? More...
static DepotID | GetDepotIndex (TileIndex t)
| Get the index of which depot is attached to the tile. More...
static VehicleType | GetDepotVehicleType (TileIndex t)
| Get the type of vehicles that can use a depot. More...

## Detailed Description

Map related accessors for depots.

Definition in file depot_map.h.

## Function Documentation

## ◆ GetDepotIndex()

static DepotID GetDepotIndex | ( | TileIndex | t | ) |
| inlinestatic

Get the index of which depot is attached to the tile.

Parameters

  t | the tile

Precondition
  IsRailDepotTile(t) || IsRoadDepotTile(t) || IsShipDepotTile(t)

Returns
  DepotID

Definition at line 52 of file depot_map.h.

References _m, IsRailDepotTile(), IsRoadDepotTile(), IsShipDepotTile(), and Tile::m2.

Referenced by Train::FindClosestDepot(), FixTTDDepots(), GetOrderCmdFromTile(), and Depot::~Depot().

## ◆ GetDepotVehicleType()

static VehicleType GetDepotVehicleType | ( | TileIndex | t | ) |
| inlinestatic

Get the type of vehicles that can use a depot.

Parameters

  t | The tile

Precondition
  IsDepotTile(t)

Returns
  the type of vehicles that can use the depot

Definition at line 65 of file depot_map.h.

References GetTileType().

Referenced by CmdBuildVehicle(), and CmdRenameDepot().

## ◆ IsDepotTile()

static bool IsDepotTile | ( | TileIndex | tile | ) |
| inlinestatic

Is the given tile a tile with a depot on it?

Parameters

  tile | the tile to check

Returns
  true if and only if there is a depot on the tile.

Definition at line 41 of file depot_map.h.

References IsHangarTile(), IsRailDepotTile(), IsRoadDepotTile(), and IsShipDepotTile().

Referenced by CmdBuildVehicle(), CmdDepotMassAutoReplace(), CmdDepotSellAllVehicles(), CmdMassStartStopVehicle(), FixTTDDepots(), and Depot::~Depot().