OpenTTD Source: src/water_map.h File Reference

OpenTTD Source 13.2.1

Data Structures | Enumerations | Functions
water_map.h File Reference
`#include "depot_type.h"`
`#include "tile_map.h"`

Go to the source code of this file.

## Data Structures
struct | EnumPropsT< WaterClass >
| Helper information for extract tool. More...

## Enumerations
enum | WaterTileTypeBitLayout { WBL_TYPE_BEGIN = 4, WBL_TYPE_COUNT = 4, WBL_TYPE_NORMAL = 0x0, WBL_TYPE_LOCK = 0x1, WBL_TYPE_DEPOT = 0x8, WBL_COAST_FLAG = 0, WBL_LOCK_ORIENT_BEGIN = 0, WBL_LOCK_ORIENT_COUNT = 2, WBL_LOCK_PART_BEGIN = 2, WBL_LOCK_PART_COUNT = 2, WBL_DEPOT_PART = 0, WBL_DEPOT_AXIS = 1 }
| Bit field layout of m5 for water tiles. More...
enum | WaterTileType { WATER_TILE_CLEAR, WATER_TILE_COAST, WATER_TILE_LOCK, WATER_TILE_DEPOT }
| Available water tile types. More...
enum | WaterClass : byte { WATER_CLASS_SEA, WATER_CLASS_CANAL, WATER_CLASS_RIVER, WATER_CLASS_INVALID }
| classes of water (for WATER_TILE_CLEAR water tile type). More...
enum | DepotPart { DEPOT_PART_NORTH = 0, DEPOT_PART_SOUTH = 1, DEPOT_PART_END }
| Sections of the water depot. More...
enum | LockPart { LOCK_PART_MIDDLE = 0, LOCK_PART_LOWER = 1, LOCK_PART_UPPER = 2 }
| Sections of the water lock. More...

## Functions
static bool | IsValidWaterClass (WaterClass wc)
| Checks if a water class is valid. More...
bool | IsPossibleDockingTile (TileIndex t)
static WaterTileType | GetWaterTileType (TileIndex t)
| Get the water tile type at a tile. More...
static bool | HasTileWaterClass (TileIndex t)
| Checks whether the tile has an waterclass associated. More...
static WaterClass | GetWaterClass (TileIndex t)
| Get the water class at a tile. More...
static void | SetWaterClass (TileIndex t, WaterClass wc)
| Set the water class at a tile. More...
static bool | IsTileOnWater (TileIndex t)
| Tests if the tile was built on water. More...
static bool | IsWater (TileIndex t)
| Is it a plain water tile? More...
static bool | IsSea (TileIndex t)
| Is it a sea water tile? More...
static bool | IsCanal (TileIndex t)
| Is it a canal tile? More...
static bool | IsRiver (TileIndex t)
| Is it a river water tile? More...
static bool | IsWaterTile (TileIndex t)
| Is it a water tile with plain water? More...
static bool | IsCoast (TileIndex t)
| Is it a coast tile? More...
static bool | IsCoastTile (TileIndex t)
| Is it a coast tile. More...
static bool | IsShipDepot (TileIndex t)
| Is it a water tile with a ship depot on it? More...
static bool | IsShipDepotTile (TileIndex t)
| Is it a ship depot tile? More...
static Axis | GetShipDepotAxis (TileIndex t)
| Get the axis of the ship depot. More...
static DepotPart | GetShipDepotPart (TileIndex t)
| Get the part of a ship depot. More...
static DiagDirection | GetShipDepotDirection (TileIndex t)
| Get the direction of the ship depot. More...
static TileIndex | GetOtherShipDepotTile (TileIndex t)
| Get the other tile of the ship depot. More...
static TileIndex | GetShipDepotNorthTile (TileIndex t)
| Get the most northern tile of a ship depot. More...
static bool | IsLock (TileIndex t)
| Is there a lock on a given water tile? More...
static DiagDirection | GetLockDirection (TileIndex t)
| Get the direction of the water lock. More...
static byte | GetLockPart (TileIndex t)
| Get the part of a lock. More...
static byte | GetWaterTileRandomBits (TileIndex t)
| Get the random bits of the water tile. More...
static bool | HasTileWaterGround (TileIndex t)
| Checks whether the tile has water at the ground. More...
static void | SetDockingTile (TileIndex t, bool b)
| Set the docking tile state of a tile. More...
static bool | IsDockingTile (TileIndex t)
| Checks whether the tile is marked as a dockling tile. More...
static void | MakeShore (TileIndex t)
| Helper function to make a coast tile. More...
static void | MakeWater (TileIndex t, Owner o, WaterClass wc, uint8 random_bits)
| Helper function for making a watery tile. More...
static void | MakeSea (TileIndex t)
| Make a sea tile. More...
static void | MakeRiver (TileIndex t, uint8 random_bits)
| Make a river tile. More...
static void | MakeCanal (TileIndex t, Owner o, uint8 random_bits)
| Make a canal tile. More...
static void | MakeShipDepot (TileIndex t, Owner o, DepotID did, DepotPart part, Axis a, WaterClass original_water_class)
| Make a ship depot section. More...
static void | MakeLockTile (TileIndex t, Owner o, LockPart part, DiagDirection dir, WaterClass original_water_class)
| Make a lock section. More...
static void | MakeLock (TileIndex t, Owner o, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle)
| Make a water lock. More...

## Detailed Description

Map accessors for water tiles.

Definition in file water_map.h.

## Enumeration Type Documentation

## ◆ DepotPart

enum DepotPart

Sections of the water depot.

Enumerator
DEPOT_PART_NORTH | Northern part of a depot.
DEPOT_PART_SOUTH | Southern part of a depot.

Definition at line 68 of file water_map.h.

## ◆ LockPart

enum LockPart

Sections of the water lock.

Enumerator
LOCK_PART_MIDDLE | Middle part of a lock.
LOCK_PART_LOWER | Lower part of a lock.
LOCK_PART_UPPER | Upper part of a lock.

Definition at line 75 of file water_map.h.

## ◆ WaterClass

enum WaterClass : byte

classes of water (for WATER_TILE_CLEAR water tile type).

Enumerator
WATER_CLASS_SEA | Sea.
WATER_CLASS_CANAL | Canal.
WATER_CLASS_RIVER | River.
WATER_CLASS_INVALID | Used for industry tiles on land (also for oilrig if newgrf says so).

Definition at line 47 of file water_map.h.

## ◆ WaterTileType

enum WaterTileType

Available water tile types.

Enumerator
WATER_TILE_CLEAR | Plain water.
WATER_TILE_COAST | Coast.
WATER_TILE_LOCK | Water lock.
WATER_TILE_DEPOT | Water Depot.

Definition at line 39 of file water_map.h.

## ◆ WaterTileTypeBitLayout

enum WaterTileTypeBitLayout

Bit field layout of m5 for water tiles.

Enumerator
WBL_TYPE_BEGIN | Start of the 'type' bitfield.
WBL_TYPE_COUNT | Length of the 'type' bitfield.
WBL_TYPE_NORMAL | Clear water or coast ('type' bitfield).
WBL_TYPE_LOCK | Lock ('type' bitfield).
WBL_TYPE_DEPOT | Depot ('type' bitfield).
WBL_COAST_FLAG | Flag for coast.
WBL_LOCK_ORIENT_BEGIN | Start of lock orientation bitfield.
WBL_LOCK_ORIENT_COUNT | Length of lock orientation bitfield.
WBL_LOCK_PART_BEGIN | Start of lock part bitfield.
WBL_LOCK_PART_COUNT | Length of lock part bitfield.
WBL_DEPOT_PART | Depot part flag.
WBL_DEPOT_AXIS | Depot axis flag.

Definition at line 19 of file water_map.h.

## Function Documentation

## ◆ GetLockDirection()

static DiagDirection GetLockDirection | ( | TileIndex | t | ) |
| inlinestatic

Get the direction of the water lock.

Parameters

  t | Water tile to query.

Returns
  Direction of the lock.

Precondition
  IsTileType(t, MP_WATER) && IsLock(t)

Definition at line 319 of file water_map.h.

References _m, GB(), IsLock(), WBL_LOCK_ORIENT_BEGIN, and WBL_LOCK_ORIENT_COUNT.

Referenced by RemoveLock().

## ◆ GetLockPart()

static byte GetLockPart | ( | TileIndex | t | ) |
| inlinestatic

Get the part of a lock.

Parameters

  t | Water tile to query.

Returns
  The part.

Precondition
  IsTileType(t, MP_WATER) && IsLock(t)

Definition at line 331 of file water_map.h.

References _m, GB(), IsLock(), WBL_LOCK_PART_BEGIN, and WBL_LOCK_PART_COUNT.

Referenced by DrawWaterLock(), CanalScopeResolver::GetVariable(), and ShipTestUpDownOnLock().

## ◆ GetOtherShipDepotTile()

static TileIndex GetOtherShipDepotTile | ( | TileIndex | t | ) |
| inlinestatic

Get the other tile of the ship depot.

Parameters

  t | Tile to query, containing one section of a ship depot.

Returns
  Tile containing the other section of the depot.

Precondition
  IsShipDepotTile(t)

Definition at line 283 of file water_map.h.

References AXIS_X, DEPOT_PART_NORTH, GetShipDepotAxis(), GetShipDepotPart(), and TileDiffXY().

Referenced by GetShipDepotNorthTile().

## ◆ GetShipDepotAxis()

static Axis GetShipDepotAxis | ( | TileIndex | t | ) |
| inlinestatic

Get the axis of the ship depot.

Parameters

  t | Water tile to query.

Returns
  Axis of the depot.

Precondition
  IsShipDepotTile(t)

Definition at line 248 of file water_map.h.

References _m, GB(), IsShipDepotTile(), and WBL_DEPOT_AXIS.

Referenced by GetOtherShipDepotTile(), and GetShipDepotDirection().

## ◆ GetShipDepotDirection()

static DiagDirection GetShipDepotDirection | ( | TileIndex | t | ) |
| inlinestatic

Get the direction of the ship depot.

Parameters

  t | Water tile to query.

Returns
  Direction of the depot.

Precondition
  IsShipDepotTile(t)

Definition at line 272 of file water_map.h.

References GetShipDepotAxis(), GetShipDepotPart(), and XYNSToDiagDir().

Referenced by GetDepotDirection(), and Ship::GetVehicleTrackdir().

## ◆ GetShipDepotNorthTile()

static TileIndex GetShipDepotNorthTile | ( | TileIndex | t | ) |
| inlinestatic

Get the most northern tile of a ship depot.

Parameters

  t | One of the tiles of the ship depot.

Returns
  The northern tile of the depot.

Precondition
  IsShipDepotTile(t)

Definition at line 294 of file water_map.h.

References GetOtherShipDepotTile(), and IsShipDepot().

Referenced by CmdBuildShip().

## ◆ GetShipDepotPart()

static DepotPart GetShipDepotPart | ( | TileIndex | t | ) |
| inlinestatic

Get the part of a ship depot.

Parameters

  t | Water tile to query.

Returns
  Part of the depot.

Precondition
  IsShipDepotTile(t)

Definition at line 260 of file water_map.h.

References _m, GB(), IsShipDepotTile(), and WBL_DEPOT_PART.

Referenced by GetOtherShipDepotTile(), and GetShipDepotDirection().

## ◆ GetWaterClass()

static WaterClass GetWaterClass | ( | TileIndex | t | ) |
| inlinestatic

Get the water class at a tile.

Parameters

  t | Water tile to query.

Precondition
  IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT)

Returns
  Water class at the tile.

Definition at line 117 of file water_map.h.

References _m, GB(), and HasTileWaterClass().

Referenced by CmdBuildShipDepot(), CmdLandscapeClear(), DoBuildLock(), GetEffectiveWaterClass(), GetFloodingBehaviour(), GetNearbyTileInformation(), IsCanal(), IsCoastTile(), IsRiver(), IsSea(), IsTileOnWater(), NeighbourIsNormal(), RemoveLock(), and SetWaterClassDependingOnSurroundings().

## ◆ GetWaterTileRandomBits()

static byte GetWaterTileRandomBits | ( | TileIndex | t | ) |
| inlinestatic

Get the random bits of the water tile.

Parameters

  t | Water tile to query.

Returns
  Random bits of the tile.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 343 of file water_map.h.

References _m, IsTileType(), Tile::m4, and MP_WATER.

Referenced by CanalScopeResolver::GetRandomBits(), and CanalScopeResolver::GetVariable().

## ◆ GetWaterTileType()

static WaterTileType GetWaterTileType | ( | TileIndex | t | ) |
| inlinestatic

Get the water tile type at a tile.

Parameters

  t | Water tile to query.

Returns
  Water tile type at the tile.

Definition at line 88 of file water_map.h.

References _m, GB(), HasBit(), IsTileType(), MP_WATER, WATER_TILE_CLEAR, WATER_TILE_COAST, WATER_TILE_DEPOT, WATER_TILE_LOCK, WBL_COAST_FLAG, WBL_TYPE_BEGIN, WBL_TYPE_COUNT, WBL_TYPE_DEPOT, WBL_TYPE_LOCK, and WBL_TYPE_NORMAL.

Referenced by IsCoast(), IsLock(), IsShipDepot(), IsWater(), and IsWateredTile().

## ◆ HasTileWaterClass()

static bool HasTileWaterClass | ( | TileIndex | t | ) |
| inlinestatic

Checks whether the tile has an waterclass associated.

You can then subsequently call GetWaterClass().

Parameters

  t | Tile to query.

Returns
  True if the tiletype has a waterclass.

Definition at line 106 of file water_map.h.

References IsTileType(), MP_INDUSTRY, MP_OBJECT, MP_STATION, MP_TREES, and MP_WATER.

Referenced by CheckIfIndustryTilesAreFree(), CmdLandscapeClear(), GetEffectiveWaterClass(), GetNearbyTileInformation(), GetWaterClass(), HasTileWaterGround(), NeighbourIsNormal(), and SetWaterClass().

## ◆ HasTileWaterGround()

static bool HasTileWaterGround | ( | TileIndex | t | ) |
| inlinestatic

Checks whether the tile has water at the ground.

That is, it is either some plain water tile, or a object/industry/station/... with water under it.

Returns
  true iff the tile has water at the ground.

Note
  Coast tiles are not considered waterish, even if there is water on a halftile.

Definition at line 355 of file water_map.h.

References HasTileWaterClass(), IsCoastTile(), and IsTileOnWater().

Referenced by CanFollowRoad(), CmdBuildBuoy(), CmdBuildShipDepot(), DoBuildLock(), and GetClosestWaterDistance().

## ◆ IsCanal()

static bool IsCanal | ( | TileIndex | t | ) |
| inlinestatic

Is it a canal tile?

Parameters

  t | Water tile to query.

Returns
  `true` if it is a canal tile.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 174 of file water_map.h.

References GetWaterClass(), IsWater(), and WATER_CLASS_CANAL.

Referenced by MarkTileDirtyIfCanalOrRiver().

## ◆ IsCoast()

static bool IsCoast | ( | TileIndex | t | ) |
| inlinestatic

Is it a coast tile?

Parameters

  t | Water tile to query.

Returns
  `true` if it is a sea water tile.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 206 of file water_map.h.

References GetWaterTileType(), and WATER_TILE_COAST.

Referenced by CanPlantTreesOnTile(), GetFloodingBehaviour(), IsCoastTile(), and SetWaterClassDependingOnSurroundings().

## ◆ IsCoastTile()

static bool IsCoastTile | ( | TileIndex | t | ) |
| inlinestatic

Is it a coast tile.

Parameters

  t | Tile to query.

Returns
  `true` if it is a coast.

Definition at line 216 of file water_map.h.

References GetWaterClass(), IsCoast(), IsTileType(), MP_TREES, MP_WATER, and WATER_CLASS_INVALID.

Referenced by CmdLandscapeClear(), and HasTileWaterGround().

## ◆ IsDockingTile()

static bool IsDockingTile | ( | TileIndex | t | ) |
| inlinestatic

Checks whether the tile is marked as a dockling tile.

Returns
  true iff the tile is marked as a docking tile.

Definition at line 376 of file water_map.h.

References _m, HasBit(), IsTileType(), MP_RAILWAY, MP_STATION, MP_TUNNELBRIDGE, and MP_WATER.

Referenced by IsShipDestinationTile(), and CYapfCostShipT< Types >::PfCalcCost().

## ◆ IsLock()

static bool IsLock | ( | TileIndex | t | ) |
| inlinestatic

Is there a lock on a given water tile?

Parameters

  t | Water tile to query.

Returns
  `true` if it is a water lock tile.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 308 of file water_map.h.

References GetWaterTileType(), and WATER_TILE_LOCK.

Referenced by GetLockDirection(), GetLockPart(), CanalScopeResolver::GetVariable(), SetWaterClassDependingOnSurroundings(), and ShipTestUpDownOnLock().

## ◆ IsRiver()

static bool IsRiver | ( | TileIndex | t | ) |
| inlinestatic

Is it a river water tile?

Parameters

  t | Water tile to query.

Returns
  `true` if it is a river water tile.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 185 of file water_map.h.

References GetWaterClass(), IsWater(), and WATER_CLASS_RIVER.

Referenced by MarkTileDirtyIfCanalOrRiver(), and RiverMakeWider().

## ◆ IsSea()

static bool IsSea | ( | TileIndex | t | ) |
| inlinestatic

Is it a sea water tile?

Parameters

  t | Water tile to query.

Returns
  `true` if it is a sea water tile.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 163 of file water_map.h.

References GetWaterClass(), IsWater(), and WATER_CLASS_SEA.

Referenced by GrowTownWithBridge().

## ◆ IsShipDepot()

static bool IsShipDepot | ( | TileIndex | t | ) |
| inlinestatic

Is it a water tile with a ship depot on it?

Parameters

  t | Water tile to query.

Returns
  `true` if it is a ship depot tile.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 227 of file water_map.h.

References GetWaterTileType(), and WATER_TILE_DEPOT.

Referenced by GetShipDepotNorthTile(), and IsShipDepotTile().

## ◆ IsShipDepotTile()

static bool IsShipDepotTile | ( | TileIndex | t | ) |
| inlinestatic

Is it a ship depot tile?

Parameters

  t | Tile to query.

Returns
  `true` if it is a ship depot tile.

Definition at line 237 of file water_map.h.

References IsShipDepot(), IsTileType(), and MP_WATER.

Referenced by GetDepotIndex(), GetShipDepotAxis(), GetShipDepotPart(), and IsDepotTile().

## ◆ IsTileOnWater()

static bool IsTileOnWater | ( | TileIndex | t | ) |
| inlinestatic

Tests if the tile was built on water.

Parameters

  t | the tile to check

Precondition
  IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT)

Returns
  true iff on water

Definition at line 141 of file water_map.h.

References GetWaterClass(), and WATER_CLASS_INVALID.

Referenced by CheckIfIndustryTilesAreFree(), CmdLandscapeClear(), and HasTileWaterGround().

## ◆ IsValidWaterClass()

static bool IsValidWaterClass | ( | WaterClass | wc | ) |
| inlinestatic

Checks if a water class is valid.

Parameters

  wc | The value to check

Returns
  true if the given value is a valid water class.

Definition at line 62 of file water_map.h.

References WATER_CLASS_INVALID.

Referenced by CmdBuildCanal().

## ◆ IsWater()

static bool IsWater | ( | TileIndex | t | ) |
| inlinestatic

Is it a plain water tile?

Parameters

  t | Water tile to query.

Returns
  `true` if any type of clear water like ocean, river, or canal.

Precondition
  IsTileType(t, MP_WATER)

Definition at line 152 of file water_map.h.

References GetWaterTileType(), and WATER_TILE_CLEAR.

Referenced by CMSAWater(), IsCanal(), IsRiver(), IsSea(), and IsWaterTile().

## ◆ IsWaterTile()

static bool IsWaterTile | ( | TileIndex | t | ) |
| inlinestatic

Is it a water tile with plain water?

Parameters

  t | Tile to query.

Returns
  `true` if it is a plain water tile.

Definition at line 195 of file water_map.h.

References IsTileType(), IsWater(), and MP_WATER.

Referenced by CheckIfIndustryTilesAreFree(), CmdLandscapeClear(), DoBuildLock(), FindSpring(), FlowRiver(), GrowTownWithBridge(), MakeLock(), and RiverMakeWider().

## ◆ MakeCanal()

static void MakeCanal | ( | TileIndex | t,
|  | Owner | o,
|  | uint8 | random_bits
| ) |  |
| inlinestatic

Make a canal tile.

Parameters

  t | The tile to change into canal
  o | The owner of the canal
  random_bits | Random bits to be set for this tile

Definition at line 446 of file water_map.h.

References MakeWater(), OWNER_WATER, and WATER_CLASS_CANAL.

## ◆ MakeLock()

static void MakeLock | ( | TileIndex | t,
|  | Owner | o,
|  | DiagDirection | d,
|  | WaterClass | wc_lower,
|  | WaterClass | wc_upper,
|  | WaterClass | wc_middle
| ) |  |
| inlinestatic

Make a water lock.

Parameters

  t | Tile to place the water lock section.
  o | Owner of the lock.
  d | Direction of the water lock.
  wc_lower | Original water class of the lower part.
  wc_upper | Original water class of the upper part.
  wc_middle | Original water class of the middle part.

Definition at line 507 of file water_map.h.

References GetTileOwner(), IsWaterTile(), LOCK_PART_LOWER, LOCK_PART_MIDDLE, LOCK_PART_UPPER, MakeLockTile(), and TileOffsByDiagDir().

## ◆ MakeLockTile()

static void MakeLockTile | ( | TileIndex | t,
|  | Owner | o,
|  | LockPart | part,
|  | DiagDirection | dir,
|  | WaterClass | original_water_class
| ) |  |
| inlinestatic

Make a lock section.

Parameters

  t | Tile to place the water lock section.
  o | Owner of the lock.
  part | Part to place.
  dir | Lock orientation
  original_water_class | Original water class.

See also
  MakeLock

Definition at line 484 of file water_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_WATER, SB(), SetDockingTile(), SetTileOwner(), SetTileType(), SetWaterClass(), WBL_LOCK_ORIENT_BEGIN, WBL_LOCK_PART_BEGIN, WBL_TYPE_BEGIN, and WBL_TYPE_LOCK.

Referenced by MakeLock().

## ◆ MakeRiver()

static void MakeRiver | ( | TileIndex | t,
|  | uint8 | random_bits
| ) |  |
| inlinestatic

Make a river tile.

Parameters

  t | The tile to change into river
  random_bits | Random bits to be set for this tile

Definition at line 435 of file water_map.h.

References MakeWater(), OWNER_WATER, and WATER_CLASS_RIVER.

Referenced by RemoveLock(), and RiverMakeWider().

## ◆ MakeSea()

static void MakeSea | ( | TileIndex | t | ) |
| inlinestatic

Make a sea tile.

Parameters

  t | The tile to change into sea

Definition at line 425 of file water_map.h.

References MakeWater(), OWNER_WATER, and WATER_CLASS_SEA.

## ◆ MakeShipDepot()

static void MakeShipDepot | ( | TileIndex | t,
|  | Owner | o,
|  | DepotID | did,
|  | DepotPart | part,
|  | Axis | a,
|  | WaterClass | original_water_class
| ) |  |
| inlinestatic

Make a ship depot section.

Parameters

  t | Tile to place the ship depot section.
  o | Owner of the depot.
  did | Depot ID.
  part | Depot part (either DEPOT_PART_NORTH or DEPOT_PART_SOUTH).
  a | Axis of the depot.
  original_water_class | Original water class.

Definition at line 461 of file water_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_WATER, SB(), SetDockingTile(), SetTileOwner(), SetTileType(), SetWaterClass(), WBL_DEPOT_AXIS, WBL_DEPOT_PART, WBL_TYPE_BEGIN, and WBL_TYPE_DEPOT.

## ◆ MakeShore()

static void MakeShore | ( | TileIndex | t | ) |
| inlinestatic

Helper function to make a coast tile.

Parameters

  t | The tile to change into water

Definition at line 386 of file water_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_WATER, OWNER_WATER, SB(), SetDockingTile(), SetTileOwner(), SetTileType(), SetWaterClass(), WATER_CLASS_SEA, WBL_COAST_FLAG, WBL_TYPE_BEGIN, and WBL_TYPE_NORMAL.

## ◆ MakeWater()

static void MakeWater | ( | TileIndex | t,
|  | Owner | o,
|  | WaterClass | wc,
|  | uint8 | random_bits
| ) |  |
| inlinestatic

Helper function for making a watery tile.

Parameters

  t | The tile to change into water
  o | The owner of the water
  wc | The class of water the tile has to be
  random_bits | Eventual random bits to be set for this tile

Definition at line 407 of file water_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_WATER, SB(), SetDockingTile(), SetTileOwner(), SetTileType(), SetWaterClass(), WBL_TYPE_BEGIN, and WBL_TYPE_NORMAL.

Referenced by MakeCanal(), MakeRiver(), and MakeSea().

## ◆ SetDockingTile()

static void SetDockingTile | ( | TileIndex | t,
|  | bool | b
| ) |  |
| inlinestatic

Set the docking tile state of a tile.

This is used by pathfinders to reach their destination. As well as water tiles, half-rail tiles, buoys and aqueduct ends can also be docking tiles.

Parameters

  t | the tile
  b | the docking tile state

Definition at line 366 of file water_map.h.

References _m, IsTileType(), MP_RAILWAY, MP_STATION, MP_TUNNELBRIDGE, MP_WATER, and SB().

Referenced by CheckForDockingTile(), MakeBridgeRamp(), MakeLockTile(), MakeShipDepot(), MakeShore(), MakeStation(), and MakeWater().

## ◆ SetWaterClass()

static void SetWaterClass | ( | TileIndex | t,
|  | WaterClass | wc
| ) |  |
| inlinestatic

Set the water class at a tile.

Parameters

  t | Water tile to change.
  wc | New water class.

Precondition
  IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT)

Definition at line 129 of file water_map.h.

References _m, HasTileWaterClass(), and SB().

Referenced by MakeIndustry(), MakeLockTile(), MakeObject(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeWater(), SetTreeGroundDensity(), and SetWaterClassDependingOnSurroundings().