OpenTTD Source 20261112-master-gbcbec5e63f
TownCache Struct Reference

Data structure with cached data of towns. More...

#include <town.h>

Public Member Functions

auto operator<=> (const TownCache &) const =default

Data Fields

uint32_t num_houses = 0
 Amount of houses.
uint32_t population = 0
 Current population of people.
TrackedViewportSign sign {}
 Location of name sign, UpdateVirtCoord updates this.
PartsOfSubsidy part_of_subsidy {}
 Is this town a source/destination of a subsidy?
std::array< uint32_t, NUM_HOUSE_ZONES > squared_town_zone_radius {}
 UpdateTownRadius updates this given the house count.
BuildingCounts< uint16_t > building_counts {}
 The number of each type of building in the town.

Detailed Description

Data structure with cached data of towns.

Definition at line 52 of file town.h.

Field Documentation

◆ building_counts

BuildingCounts<uint16_t> TownCache::building_counts {}

The number of each type of building in the town.

Definition at line 58 of file town.h.

Referenced by DecreaseBuildingCount(), IncreaseBuildingCount(), InitializeBuildingCounts(), and TryBuildTownHouse().

◆ num_houses

uint32_t TownCache::num_houses = 0

◆ part_of_subsidy

PartsOfSubsidy TownCache::part_of_subsidy {}

Is this town a source/destination of a subsidy?

Definition at line 56 of file town.h.

Referenced by CheckSubsidised().

◆ population

◆ sign

TrackedViewportSign TownCache::sign {}

Location of name sign, UpdateVirtCoord updates this.

Definition at line 55 of file town.h.

Referenced by CmdDeleteTown().

◆ squared_town_zone_radius

std::array<uint32_t, NUM_HOUSE_ZONES> TownCache::squared_town_zone_radius {}

UpdateTownRadius updates this given the house count.

Definition at line 57 of file town.h.

Referenced by CmdBuildBridge(), CmdBuildRoad(), CmdBuildTunnel(), TryBuildTownLighthouse(), and UpdateTownRadius().


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