OpenTTD Source 20250812-master-gf1a33d50a7
|
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 "../misc/history_func.hpp"
#include "../safeguards.h"
Go to the source code of this file.
Data Structures | |
class | SlTownOldSupplied |
class | SlTownSuppliedHistory |
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 std::array< Town::SuppliedHistory, 2 > | _old_pass_supplied {} |
static std::array< Town::SuppliedHistory, 2 > | _old_mail_supplied {} |
static const SaveLoad | _town_desc [] |
static const HIDSChunkHandler | HIDS |
static const CITYChunkHandler | CITY |
static const ChunkHandlerRef | town_chunk_handlers [] |
Code handling saving and loading of towns and houses.
Definition in file town_sl.cpp.
void RebuildTownCaches | ( | ) |
Rebuild all the cached variables of towns.
Definition at line 28 of file town_sl.cpp.
References Town::cache, HouseSpec::Get(), GetHouseNorthPart(), GetHouseType(), IncreaseBuildingCount(), InitializeBuildingCounts(), IsHouseCompleted(), IsTileType(), Map::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_town_pool >::Iterate(), MP_HOUSE, TownCache::num_houses, HouseSpec::population, TownCache::population, TileDiffXY(), and UpdateTownRadius().
Referenced by CheckCaches(), and 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 65 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(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and TileDiffXY().
Referenced by AfterLoadGame(), and ReloadNewGRFData().
|
static |
Definition at line 252 of file town_sl.cpp.
|
static |
Definition at line 251 of file town_sl.cpp.
|
static |
Definition at line 254 of file town_sl.cpp.
|
static |
Definition at line 385 of file town_sl.cpp.
|
static |
Definition at line 384 of file town_sl.cpp.
|
static |
Definition at line 386 of file town_sl.cpp.