OpenTTD Source 20241224-master-gee860a5c8e
town_sl.cpp File Reference

Code handling saving and loading of towns and houses. More...

#include "../stdafx.h"
#include "saveload.h"
#include "compat/town_sl_compat.h"
#include "newgrf_sl.h"
#include "../newgrf_house.h"
#include "../town.h"
#include "../landscape.h"
#include "../subsidy_func.h"
#include "../strings_func.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

class  SlTownSupplied
 
class  SlTownReceived
 
class  SlTownAcceptanceMatrix
 
struct  SlTownAcceptanceMatrix::AcceptanceMatrix
 Compatibility struct with just enough of TileMatrix to facilitate loading. More...
 
struct  HIDSChunkHandler
 
struct  CITYChunkHandler
 

Functions

void RebuildTownCaches ()
 Rebuild all the cached variables of towns.
 
void UpdateHousesAndTowns ()
 Check and update town and house values.
 
const ChunkHandlerTable _town_chunk_handlers (town_chunk_handlers)
 

Variables

static const SaveLoad _town_desc []
 
static const HIDSChunkHandler HIDS
 
static const CITYChunkHandler CITY
 
static const ChunkHandlerRef town_chunk_handlers []
 

Detailed Description

Code handling saving and loading of towns and houses.

Definition in file town_sl.cpp.

Function Documentation

◆ RebuildTownCaches()

◆ UpdateHousesAndTowns()

void UpdateHousesAndTowns ( )

Check and update town and house values.

Checked are the HouseIDs. Updated are the town population the number of houses per town, the town radius and the max passengers of the town.

Definition at line 64 of file town_sl.cpp.

References HouseSpec::building_flags, HouseSpec::Get(), GetCleanHouseType(), GetHouseNorthPart(), OverrideManagerBase::GetSubstituteID(), IsTileType(), Map::Iterate(), MP_HOUSE, NEW_HOUSE_OFFSET, RebuildTownCaches(), SetHouseType(), and TileDiffXY().

Referenced by AfterLoadGame(), and ReloadNewGRFData().

Variable Documentation

◆ _town_desc

const SaveLoad _town_desc[]
static

Definition at line 208 of file town_sl.cpp.

◆ CITY

const CITYChunkHandler CITY
static

Definition at line 323 of file town_sl.cpp.

◆ HIDS

const HIDSChunkHandler HIDS
static

Definition at line 322 of file town_sl.cpp.

◆ town_chunk_handlers

const ChunkHandlerRef town_chunk_handlers[]
static
Initial value:
= {
HIDS,
CITY,
}

Definition at line 324 of file town_sl.cpp.