OpenTTD Source: src/town_type.h File Reference

OpenTTD Source 12.2

Data Structures | Typedefs | Enumerations | Variables
town_type.h File Reference
`#include "core/enum_type.hpp"`

Go to the source code of this file.

## Data Structures
struct | EnumPropsT< TownSize >
struct | EnumPropsT< TownLayout >
struct | TransportedCargoStat< Tstorage >
| Store the maximum and actually transported cargo amount for the current and the last month. More...

## Typedefs
typedef uint16 | TownID

## Enumerations
enum | TownSize { TSZ_SMALL, TSZ_MEDIUM, TSZ_LARGE, TSZ_RANDOM, TSZ_END }
| Supported initial town sizes. More...
enum | Ratings { RATING_MINIMUM = -1000, RATING_APPALLING = -400, RATING_VERYPOOR = -200, RATING_POOR = 0, RATING_MEDIOCRE = 200, RATING_GOOD = 400, RATING_VERYGOOD = 600, RATING_EXCELLENT = 800, RATING_OUTSTANDING = 1000, RATING_MAXIMUM = RATING_OUTSTANDING, RATING_INITIAL = 500, RATING_TREE_DOWN_STEP = -35, RATING_TREE_MINIMUM = RATING_MINIMUM, RATING_TREE_UP_STEP = 7, RATING_TREE_MAXIMUM = 220, RATING_GROWTH_UP_STEP = 5, RATING_GROWTH_MAXIMUM = RATING_MEDIOCRE, RATING_STATION_UP_STEP = 12, RATING_STATION_DOWN_STEP = -15, RATING_TUNNEL_BRIDGE_DOWN_STEP = -250, RATING_TUNNEL_BRIDGE_MINIMUM = 0, RATING_TUNNEL_BRIDGE_NEEDED_PERMISSIVE = 144, RATING_TUNNEL_BRIDGE_NEEDED_NEUTRAL = 208, RATING_TUNNEL_BRIDGE_NEEDED_HOSTILE = 400, RATING_ROAD_DOWN_STEP_INNER = -50, RATING_ROAD_DOWN_STEP_EDGE = -18, RATING_ROAD_MINIMUM = -100, RATING_ROAD_NEEDED_PERMISSIVE = 16, RATING_ROAD_NEEDED_NEUTRAL = 64, RATING_ROAD_NEEDED_HOSTILE = 112, RATING_HOUSE_MINIMUM = RATING_MINIMUM, RATING_BRIBE_UP_STEP = 200, RATING_BRIBE_MAXIMUM = 800, RATING_BRIBE_DOWN_TO = -50 }
enum | TownLayout : byte { TL_BEGIN = 0, TL_ORIGINAL = 0, TL_BETTER_ROADS, TL_2X2_GRID, TL_3X3_GRID, TL_RANDOM, NUM_TLS }
| Town Layouts. More...
enum | TownFounding : byte { TF_BEGIN = 0, TF_FORBIDDEN = 0, TF_ALLOWED, TF_CUSTOM_LAYOUT, TF_END }
| Town founding setting values. More...
enum | TownCargoGenMode : byte { TCGM_BEGIN = 0, TCGM_ORIGINAL = 0, TCGM_BITCOUNT, TCGM_END }
| Town cargo generation modes. More...

## Variables
static const uint | MAX_LENGTH_TOWN_NAME_CHARS = 32
| The maximum length of a town name in characters including '\0'.

## Detailed Description

Types related to towns.

Definition in file town_type.h.

## Enumeration Type Documentation

## ◆ Ratings

enum Ratings

Enumerator
RATING_OUTSTANDING | OUTSTANDING.
RATING_INITIAL | initial rating
RATING_GROWTH_UP_STEP | when a town grows, all companies have rating increased a bit ...
RATING_GROWTH_MAXIMUM | ... up to RATING_MEDIOCRE
RATING_STATION_UP_STEP | when a town grows, company gains reputation for all well serviced stations ...
RATING_STATION_DOWN_STEP | ... but loses for badly serviced stations
RATING_TUNNEL_BRIDGE_DOWN_STEP | penalty for removing town owned tunnel or bridge
RATING_TUNNEL_BRIDGE_MINIMUM | minimum rating after removing tunnel or bridge
RATING_TUNNEL_BRIDGE_NEEDED_PERMISSIVE | rating needed, "Permissive" difficulty settings
RATING_TUNNEL_BRIDGE_NEEDED_NEUTRAL | "Neutral"
RATING_TUNNEL_BRIDGE_NEEDED_HOSTILE | "Hostile"
RATING_ROAD_DOWN_STEP_INNER | removing a roadpiece in the middle
RATING_ROAD_DOWN_STEP_EDGE | removing a roadpiece at the edge
RATING_ROAD_MINIMUM | minimum rating after removing town owned road
RATING_ROAD_NEEDED_PERMISSIVE | rating needed, "Permissive" difficulty settings
RATING_ROAD_NEEDED_NEUTRAL | "Neutral"
RATING_ROAD_NEEDED_HOSTILE | "Hostile"

Definition at line 29 of file town_type.h.

## ◆ TownCargoGenMode

enum TownCargoGenMode : byte

Town cargo generation modes.

Enumerator
TCGM_ORIGINAL | Original algorithm (quadratic cargo by population)
TCGM_BITCOUNT | Bit-counted algorithm (normal distribution from individual house population)

Definition at line 101 of file town_type.h.

## ◆ TownFounding

enum TownFounding : byte

Town founding setting values.

It needs to be 8bits, because we save and load it as such

Enumerator
TF_BEGIN | Used for iterations and limit testing.
TF_FORBIDDEN | Forbidden.
TF_ALLOWED | Allowed.
TF_CUSTOM_LAYOUT | Allowed, with custom town layout.
TF_END | Used for iterations and limit testing.

Definition at line 92 of file town_type.h.

## ◆ TownLayout

enum TownLayout : byte

Town Layouts.

It needs to be 8bits, because we save and load it as such

Enumerator
TL_ORIGINAL | Original algorithm (min. 1 distance between roads)
TL_BETTER_ROADS | Extended original algorithm (min. 2 distance between roads)
TL_2X2_GRID | Geometric 2x2 grid algorithm.
TL_3X3_GRID | Geometric 3x3 grid algorithm.
TL_RANDOM | Random town layout.
NUM_TLS | Number of town layouts.

Definition at line 78 of file town_type.h.

## ◆ TownSize

enum TownSize

Supported initial town sizes.

Enumerator
TSZ_SMALL | Small town.
TSZ_MEDIUM | Medium town.
TSZ_LARGE | Large town.
TSZ_RANDOM | Random size, bigger than small, smaller than large.
TSZ_END | Number of available town sizes.

Definition at line 19 of file town_type.h.