MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / PtInExtendedRect

Method PtInExtendedRect

src/station.cpp:564–568  ·  view source on GitHub ↗

* Determines whether a given point (x, y) is within a certain distance of * the station rectangle. * @note x and y are in Tile coordinates * @param x X coordinate * @param y Y coordinate * @param distance The maximum distance a point may have (L1 norm) * @return true if the point is within distance tiles of the station rectangle */

Source from the content-addressed store, hash-verified

562 * @return true if the point is within distance tiles of the station rectangle
563 */
564bool StationRect::PtInExtendedRect(int x, int y, int distance) const
565{
566 return this->left - distance <= x && x <= this->right + distance &&
567 this->top - distance <= y && y <= this->bottom + distance;
568}
569
570bool StationRect::IsEmpty() const
571{

Callers 5

BeforeAddTileMethod · 0.95
AfterRemoveRectMethod · 0.95
CmdMoveWaypointNameFunction · 0.80
CmdMoveStationNameFunction · 0.80
GetTileHighlightTypeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected