OpenTTD Source 20241224-master-gf74b0cf984
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
 Amount of houses.
 
uint32_t population
 Current population of people.
 
TrackedViewportSign sign
 Location of name sign, UpdateVirtCoord updates this.
 
PartOfSubsidy part_of_subsidy
 Is this town a source/destination of a subsidy?
 
std::array< uint32_t, HZB_END > 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 42 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 48 of file town.h.

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

◆ num_houses

◆ part_of_subsidy

PartOfSubsidy TownCache::part_of_subsidy

Is this town a source/destination of a subsidy?

Definition at line 46 of file town.h.

Referenced by CheckSubsidised().

◆ population

◆ sign

TrackedViewportSign TownCache::sign

Location of name sign, UpdateVirtCoord updates this.

Definition at line 45 of file town.h.

Referenced by CmdDeleteTown(), and Town::UpdateVirtCoord().

◆ squared_town_zone_radius

std::array<uint32_t, HZB_END> TownCache::squared_town_zone_radius

UpdateTownRadius updates this given the house count.

Definition at line 47 of file town.h.

Referenced by CmdBuildBridge(), CmdBuildRoad(), CmdBuildTunnel(), TownScopeResolver::GetVariable(), and UpdateTownRadius().


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