# newgrf_commons.cpp File Reference

Implementation of the class OverrideManagerBase and its descendance, present and futur. More...

`#include "stdafx.h"`
`#include "landscape.h"`
`#include "house.h"`
`#include "industrytype.h"`
`#include "newgrf.h"`
`#include "newgrf_commons.h"`
`#include "station_map.h"`
`#include "tree_map.h"`
`#include "core/mem_func.hpp"`

Go to the source code of this file.

## Functions
uint32 | GetTerrainType (TileIndex tile)
| Function used by houses (and soon industries) to get information on type of "terrain" the tile it is queries sits on.
TileIndex | GetNearbyTile (byte parameter, TileIndex tile)
uint32 | GetNearbyTileInformation (TileIndex tile)
| Common part of station var 0x67, house var 0x62, indtile var 0x60, industry var 0x62.

## Detailed Description

Implementation of the class OverrideManagerBase and its descendance, present and futur.

Definition in file newgrf_commons.cpp.

## Function Documentation

uint32 GetNearbyTileInformation | ( | TileIndex | tile | ) |

Common part of station var 0x67, house var 0x62, indtile var 0x60, industry var 0x62.

Parameters:

  | tile | the tile of interest.

Returns:
  0czzbbss: c = TileType; zz = TileZ; bb: 7-3 zero, 4-2 TerrainType, 1 water/shore, 0 zero; ss = TileSlope

Definition at line 313 of file newgrf_commons.cpp.

References GetTerrainType(), GetTileSlope(), GetTileType(), GetTreeGround(), IsTileType(), MP_TREES, MP_WATER, and TREE_GROUND_SHORE.

Referenced by GetNearbyIndustryTileInformation(), and HouseGetVariable().

uint32 GetTerrainType | ( | TileIndex | tile | ) |

Function used by houses (and soon industries) to get information on type of "terrain" the tile it is queries sits on.

Parameters:

  | tile | TileIndex of the tile been queried

Returns:
  value corresponding to the grf expected format: Terrain type: 0 normal, 1 desert, 2 rainforest, 4 on or above snowline

Definition at line 283 of file newgrf_commons.cpp.

References _settings_game, GameSettings::game_creation, GetSnowLine(), GetTileZ(), GetTropicZone(), and GameCreationSettings::landscape.

Referenced by GetNearbyTileInformation(), and HouseGetVariable().