OpenTTD Source 20241224-master-gee860a5c8e
|
Represents the covered area of e.g. More...
#include <tilearea_type.h>
Public Member Functions | |
OrthogonalTileArea (TileIndex tile=INVALID_TILE, uint16_t w=0, uint16_t h=0) | |
Construct this tile area with some set values. | |
OrthogonalTileArea (TileIndex start, TileIndex end) | |
Construct this tile area based on two points. | |
void | Add (TileIndex to_add) |
Add a single tile to a tile area; enlarge if needed. | |
void | Clear () |
Clears the 'tile area', i.e. | |
bool | Intersects (const OrthogonalTileArea &ta) const |
Does this tile area intersect with another? | |
bool | Contains (TileIndex tile) const |
Does this tile area contain a tile? | |
OrthogonalTileArea & | Expand (int rad) |
Expand a tile area by rad tiles in each direction, keeping within map bounds. | |
void | ClampToMap () |
Clamp the tile area to map borders. | |
TileIndex | GetCenterTile () const |
Get the center tile. | |
OrthogonalTileIterator | begin () const |
Returns an iterator to the beginning of the tile area. | |
OrthogonalTileIterator | end () const |
Returns an iterator to the end of the tile area. | |
Data Fields | |
TileIndex | tile |
The base tile of the area. | |
uint16_t | w |
The width of the area. | |
uint16_t | h |
The height of the area. | |
|
inline |
Construct this tile area with some set values.
tile | the base tile |
w | the width |
h | the height |
Definition at line 29 of file tilearea_type.h.
void OrthogonalTileArea::Add | ( | TileIndex | to_add | ) |
Add a single tile to a tile area; enlarge if needed.
to_add | The tile to add |
Definition at line 43 of file tilearea.cpp.
References h, INVALID_TILE, tile, TileX(), TileXY(), TileY(), and w.
Referenced by CheckCaches(), CheckForDockingTile(), CmdBuildAirport(), CmdBuildDock(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), DoCreateNewIndustry(), and RemoveRoadStop().
OrthogonalTileIterator OrthogonalTileArea::begin | ( | ) | const |
Returns an iterator to the beginning of the tile area.
Definition at line 153 of file tilearea.cpp.
void OrthogonalTileArea::ClampToMap | ( | ) |
Clamp the tile area to map borders.
Definition at line 142 of file tilearea.cpp.
References h, Map::Size(), Map::SizeX(), Map::SizeY(), tile, TileX(), TileY(), and w.
Referenced by CommonRaiseLowerBigLand(), and SmallMapWindow::DrawSmallMapColumn().
|
inline |
Clears the 'tile area', i.e.
make the tile invalid.
Definition at line 40 of file tilearea_type.h.
References INVALID_TILE.
Referenced by RemoveAirport(), RemoveDock(), and RemoveRoadStop().
bool OrthogonalTileArea::Contains | ( | TileIndex | tile | ) | const |
Does this tile area contain a tile?
tile | Tile to test for. |
Definition at line 104 of file tilearea.cpp.
References h, IsInsideBS(), tile, TileX(), TileY(), and w.
Referenced by BitmapTileArea::ClrTile(), WaterRegion::ForceUpdate(), WaterRegion::GetLabel(), WaterRegion::GetLocalIndex(), BitmapTileArea::HasTile(), and BitmapTileArea::SetTile().
OrthogonalTileIterator OrthogonalTileArea::end | ( | ) | const |
Returns an iterator to the end of the tile area.
Definition at line 162 of file tilearea.cpp.
Referenced by OrthogonalTileArea().
OrthogonalTileArea & OrthogonalTileArea::Expand | ( | int | rad | ) |
Expand a tile area by rad tiles in each direction, keeping within map bounds.
rad | Number of tiles to expand |
Definition at line 123 of file tilearea.cpp.
References h, Map::SizeX(), Map::SizeY(), tile, TileX(), TileXY(), TileY(), and w.
Referenced by FindSubsidyCargoDestination(), FindSubsidyTownCargoRoute(), ForAllStationsAroundTiles(), GetAcceptanceAroundTiles(), GetProductionAroundTiles(), GetStationAround(), PlaceTreeGroupAroundTile(), and Station::RecomputeCatchment().
|
inline |
Get the center tile.
Definition at line 59 of file tilearea_type.h.
References TileAddXY().
Referenced by IndustryViewWindow::OnClick().
bool OrthogonalTileArea::Intersects | ( | const OrthogonalTileArea & | ta | ) | const |
uint16_t OrthogonalTileArea::h |
The height of the area.
Definition at line 21 of file tilearea_type.h.
Referenced by Add(), AddNearbyStation(), AfterLoadGame(), AircraftController(), BuildStationPart(), CalcClosestStationTile(), CanExpandRailStation(), CheckCaches(), CheckIfCanLevelIndustryPlatform(), ClampToMap(), CmdBuildDock(), CmdBuildRoadStop(), CommonRaiseLowerBigLand(), Contains(), Expand(), FindStationsAroundSelection(), FindStationsNearby(), StationFinder::GetStations(), Waypoint::GetTileArea(), IndustriesScopeResolver::GetVariable(), BitmapTileArea::Initialize(), Intersects(), Waypoint::IsSingleTile(), OrthogonalTileArea(), PlaceRoadStop(), RemoveRailStation(), BitmapTileArea::Reset(), and StationResolverObject::ResolveReal().
TileIndex OrthogonalTileArea::tile |
The base tile of the area.
Definition at line 19 of file tilearea_type.h.
Referenced by Add(), AddNearbyStation(), AfterLoadGame(), AircraftController(), AircraftGetEntryPoint(), AirportGetNearestTown(), BuildStationPart(), CalcClosestStationTile(), CalculateRailStationCost(), CanExpandRailStation(), ChangeIndustryProduction(), CheckCaches(), CheckIfCallBackAllowsCreation(), CheckIfCanLevelIndustryPlatform(), ChopLumberMillTrees(), ClampToMap(), BitmapTileArea::ClrTile(), CmdBuildAirport(), CmdBuildDock(), CmdBuildRailStation(), CmdBuildRailWaypoint(), CmdRemoveFromRailStation(), Contains(), Disaster_CoalMine_Init(), Disaster_Helicopter_Init(), DisasterTick_Aircraft(), IndustryViewWindow::DrawInfo(), Expand(), FindNearestHangar(), FindStationsAroundSelection(), FindStationsNearby(), WaterRegion::ForceUpdate(), GetCargoSuffix(), Station::GetCatchmentRadius(), GetCountAndDistanceOfClosestInstance(), Airport::GetHangarDataByTile(), Airport::GetHangarExitDirection(), Airport::GetHangarNum(), WaterRegion::GetLocalIndex(), Order::GetLocation(), Airport::GetRotatedTileFromOffset(), Airport::GetSpec(), GetTargetAirportIfValid(), Waypoint::GetTileArea(), AirportTileScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), IndustryTileScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), BitmapTileArea::HasTile(), IndustryProductionCallback(), IndustryTemporarilyRefusesCargo(), Intersects(), Station::MarkTilesDirty(), Train::OnNewEconomyDay(), OrthogonalTileArea(), PerformIndustryTileSlopeCheck(), PlaceRoadStop(), ProcessOrders(), RemoveAirport(), RemoveDock(), RemoveFromRailBaseStation(), RemoveRoadWaypointStop(), NIHIndustry::Resolve(), NIHAirport::Resolve(), BitmapTileArea::SetTile(), AirportScopeResolver::StorePSA(), and UpdateAirplanesOnNewStation().
uint16_t OrthogonalTileArea::w |
The width of the area.
Definition at line 20 of file tilearea_type.h.
Referenced by Add(), AddNearbyStation(), AfterLoadGame(), AircraftController(), BuildStationPart(), CalcClosestStationTile(), CanExpandRailStation(), CheckCaches(), CheckIfCallBackAllowsCreation(), CheckIfCanLevelIndustryPlatform(), ClampToMap(), CmdBuildDock(), CmdBuildRoadStop(), CommonRaiseLowerBigLand(), Contains(), Expand(), FindStationsAroundSelection(), FindStationsNearby(), StationFinder::GetStations(), Waypoint::GetTileArea(), IndustriesScopeResolver::GetVariable(), BitmapTileArea::Initialize(), Intersects(), Waypoint::IsSingleTile(), OrthogonalTileArea(), PerformIndustryTileSlopeCheck(), PlaceRoadStop(), RemoveRailStation(), BitmapTileArea::Reset(), and StationResolverObject::ResolveReal().