|
OpenTTD Source 20260311-master-g511d3794ce
|
Handling of station tiles. More...
#include "stdafx.h"#include "core/flatset_type.hpp"#include "aircraft.h"#include "bridge_map.h"#include "vehiclelist_func.h"#include "viewport_func.h"#include "viewport_kdtree.h"#include "command_func.h"#include "town.h"#include "news_func.h"#include "train.h"#include "ship.h"#include "roadveh.h"#include "industry.h"#include "newgrf_cargo.h"#include "newgrf_debug.h"#include "newgrf_station.h"#include "newgrf_canal.h"#include "pathfinder/yapf/yapf_cache.h"#include "road_internal.h"#include "autoslope.h"#include "water.h"#include "tilehighlight_func.h"#include "strings_func.h"#include "clear_func.h"#include "timer/timer_game_calendar.h"#include "vehicle_func.h"#include "string_func.h"#include "animated_tile_func.h"#include "elrail_func.h"#include "station_base.h"#include "station_func.h"#include "station_kdtree.h"#include "roadstop_base.h"#include "newgrf_railtype.h"#include "newgrf_roadtype.h"#include "waypoint_base.h"#include "waypoint_func.h"#include "pbs.h"#include "debug.h"#include "core/random_func.hpp"#include "core/container_func.hpp"#include "company_base.h"#include "table/airporttile_ids.h"#include "newgrf_airporttiles.h"#include "order_backup.h"#include "newgrf_house.h"#include "company_gui.h"#include "linkgraph/linkgraph_base.h"#include "linkgraph/refresh.h"#include "tunnelbridge_map.h"#include "station_cmd.h"#include "waypoint_cmd.h"#include "landscape_cmd.h"#include "rail_cmd.h"#include "newgrf_roadstop.h"#include "timer/timer.h"#include "timer/timer_game_economy.h"#include "timer/timer_game_tick.h"#include "cheat_type.h"#include "road_func.h"#include "station_layout_type.h"#include "widgets/station_widget.h"#include "widgets/misc_widget.h"#include "table/strings.h"#include "table/station_land.h"#include <bitset>#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | StationNameInformation |
| Information to handle station action 0 property 24 correctly. More... | |
Typedefs | |
| typedef bool(* | CMSAMatcher) (TileIndex tile) |
| Function to check whether the given tile matches some criterion. | |
Enumerations | |
| enum | StationNaming : uint8_t { Rail , Road , Airport , Oilrig , Dock , Heliport } |
| Station types a station could be named after. More... | |
Functions | |
| bool | IsHangar (Tile t) |
| Check whether the given tile is a hangar. | |
| template<class T, class F> | |
| CommandCost | GetStationAround (TileArea ta, StationID closest_station, CompanyID company, T **st, F filter) |
| Look for a station owned by the given company around the given tile area. | |
| static int | CountMapSquareAround (TileIndex tile, CMSAMatcher cmp) |
| Counts the numbers of tiles matching a specific type in the area around. | |
| static bool | CMSAMine (TileIndex tile) |
| Check whether the tile is a mine. | |
| static bool | CMSAWater (TileIndex tile) |
| Check whether the tile is water. | |
| static bool | CMSATree (TileIndex tile) |
| Check whether the tile is a tree. | |
| static StringID | GenerateStationName (Station *st, TileIndex tile, StationNaming name_class) |
| Generate a station name for the given station at the given location. | |
| static Station * | GetClosestDeletedStation (TileIndex tile) |
| Find the closest deleted station of the current company. | |
| void | UpdateAllStationVirtCoords () |
| Update the virtual coords needed to draw the station sign for all stations. | |
| void | ClearAllStationCachedNames () |
| CargoTypes | GetAcceptanceMask (const Station *st) |
| Get a mask of the cargo types that the station accepts. | |
| CargoTypes | GetEmptyMask (const Station *st) |
| Get a mask of the cargo types that are empty at the station. | |
| static void | ShowRejectOrAcceptNews (const Station *st, CargoTypes cargoes, bool reject) |
| Add news item for when a station changes which cargoes it accepts. | |
| CargoArray | GetProductionAroundTiles (TileIndex north_tile, int w, int h, int rad) |
| Get the cargo types being produced around the tile (in a rectangle). | |
| std::pair< CargoArray, CargoTypes > | GetAcceptanceAroundTiles (TileIndex center_tile, int w, int h, int rad) |
| Get the acceptance of cargoes around the tile in 1/8. | |
| static std::pair< CargoArray, CargoTypes > | GetAcceptanceAroundStation (const Station *st) |
| Get the acceptance of cargoes around the station in. | |
| void | UpdateStationAcceptance (Station *st, bool show_msg) |
| Update the acceptance for a station. | |
| static void | UpdateStationSignCoord (BaseStation *st) |
| static CommandCost | BuildStationPart (Station **st, DoCommandFlags flags, bool reuse, TileArea area, StationNaming name_class) |
| Common part of building various station parts and possibly attaching them to an existing one. | |
| static void | DeleteStationIfEmpty (BaseStation *st) |
| This is called right after a station was deleted. | |
| CommandCost | ClearTile_Station (TileIndex tile, DoCommandFlags flags) |
| Tile callback function signature for clearing a tile. | |
| CommandCost | CheckBuildableTile (TileIndex tile, DiagDirections invalid_dirs, int &allowed_z, bool allow_steep, bool check_bridge=true) |
| Checks if the given tile is buildable, flat and has a certain height. | |
| static CommandCost | CheckFlatLandAirport (AirportTileTableIterator tile_iter, DoCommandFlags flags) |
| Checks if an airport can be built at the given location and clear the area. | |
| static StringID | GetBridgeTooLowMessageForStationType (StationType type) |
| Get station-type-specific string for a bridge that is too low. | |
| static CommandCost | IsStationBridgeAboveOk (TileIndex tile, std::span< const BridgeableTileInfo > bridgeable_info, StationType type, StationGfx layout, int bridge_height, StringID disallowed_msg=INVALID_STRING_ID) |
| Test if a bridge can be built above a station. | |
| static std::span< const BridgeableTileInfo > | GetStationBridgeableTileInfo (StationType type) |
| Get bridgeable tile information for a station type. | |
| CommandCost | IsRailStationBridgeAboveOk (TileIndex tile, const StationSpec *spec, StationType type, StationGfx layout) |
| Test if a rail station can be built below a bridge. | |
| CommandCost | IsRoadStationBridgeAboveOk (TileIndex tile, const RoadStopSpec *spec, StationType type, StationGfx layout) |
| Test if a road station can be built below a bridge. | |
| static CommandCost | IsDockBridgeAboveOk (TileIndex tile, StationGfx layout) |
| Test if a dock can be built below a bridge. | |
| CommandCost | IsBuoyBridgeAboveOk (TileIndex tile) |
| Test if a buoy can be built below a bridge. | |
| static CommandCost | CheckFlatLandRailStation (TileIndex tile_cur, TileIndex north_tile, int &allowed_z, DoCommandFlags flags, Axis axis, StationID *station, RailType rt, std::vector< Train * > &affected_vehicles, StationClassID spec_class, uint16_t spec_index, uint8_t plat_len, uint8_t numtracks) |
| Checks if a rail station can be built at the given tile. | |
| static CommandCost | CheckFlatLandRoadStop (TileIndex cur_tile, int &allowed_z, const RoadStopSpec *spec, DoCommandFlags flags, DiagDirections invalid_dirs, bool is_drive_through, StationType station_type, Axis axis, StationID *station, RoadType rt) |
| Checks if a road stop can be built at the given tile. | |
| CommandCost | CanExpandRailStation (const BaseStation *st, TileArea &new_ta) |
| Check whether we can expand the rail part of the given station. | |
| template<class T, StringID error_message, class F> | |
| CommandCost | FindJoiningBaseStation (StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, T **st, F filter) |
| Find a nearby station that joins this station. | |
| static CommandCost | FindJoiningStation (StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Station **st) |
| Find a nearby station that joins this station. | |
| CommandCost | FindJoiningWaypoint (StationID existing_waypoint, StationID waypoint_to_join, bool adjacent, TileArea ta, Waypoint **wp, bool is_road) |
| Find a nearby waypoint that joins this waypoint. | |
| static void | FreeTrainReservation (Train *v) |
| Clear platform reservation during station building/removing. | |
| static void | RestoreTrainReservation (Train *v) |
| Restore platform reservation during station building/removing. | |
| static CommandCost | CalculateRailStationCost (TileArea tile_area, DoCommandFlags flags, Axis axis, StationID *station, RailType rt, std::vector< Train * > &affected_vehicles, StationClassID spec_class, uint16_t spec_index, uint8_t plat_len, uint8_t numtracks) |
| Calculates cost of new rail stations within the area. | |
| static StationSpec::TileFlags | GetStationTileFlags (StationGfx gfx, const StationSpec *statspec) |
| Get station tile flags for the given StationGfx. | |
| void | SetRailStationTileFlags (TileIndex tile, const StationSpec *statspec) |
| Set rail station tile flags for the given tile. | |
| CommandCost | CmdBuildRailStation (DoCommandFlags flags, TileIndex tile_org, RailType rt, Axis axis, uint8_t numtracks, uint8_t plat_len, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent) |
| Build rail station. | |
| static TileArea | MakeStationAreaSmaller (BaseStation *st, TileArea ta, bool(*func)(BaseStation *, TileIndex)) |
| static bool | TileBelongsToRailStation (BaseStation *st, TileIndex tile) |
| static void | MakeRailStationAreaSmaller (BaseStation *st) |
| static bool | TileBelongsToShipStation (BaseStation *st, TileIndex tile) |
| static void | MakeShipStationAreaSmaller (Station *st) |
| static bool | TileBelongsToRoadWaypointStation (BaseStation *st, TileIndex tile) |
| void | MakeRoadWaypointStationAreaSmaller (BaseStation *st, TileArea &road_waypoint_area) |
| template<class T> | |
| CommandCost | RemoveFromRailBaseStation (TileArea ta, std::vector< T * > &affected_stations, DoCommandFlags flags, Money removal_cost, bool keep_rail) |
| Remove a number of tiles from any rail station within the area. | |
| CommandCost | CmdRemoveFromRailStation (DoCommandFlags flags, TileIndex start, TileIndex end, bool keep_rail) |
| Remove a single tile from a rail station. | |
| CommandCost | CmdRemoveFromRailWaypoint (DoCommandFlags flags, TileIndex start, TileIndex end, bool keep_rail) |
| Remove a single tile from a waypoint. | |
| template<class T> | |
| CommandCost | RemoveRailStation (T *st, DoCommandFlags flags, Money removal_cost) |
| Remove a rail station/waypoint. | |
| static CommandCost | RemoveRailStation (TileIndex tile, DoCommandFlags flags) |
| Remove a rail station. | |
| static CommandCost | RemoveRailWaypoint (TileIndex tile, DoCommandFlags flags) |
| Remove a rail waypoint. | |
| static RoadStop ** | FindRoadStopSpot (bool truck_station, Station *st) |
| static CommandCost | RemoveRoadStop (TileIndex tile, DoCommandFlags flags, int replacement_spec_index) |
| Remove a bus station/truck stop. | |
| CommandCost | RemoveRoadWaypointStop (TileIndex tile, DoCommandFlags flags, int replacement_spec_index) |
| Remove a road waypoint. | |
| static CommandCost | FindJoiningRoadStop (StationID existing_stop, StationID station_to_join, bool adjacent, TileArea ta, Station **st) |
| Find a nearby station that joins this road stop. | |
| CommandCost | CalculateRoadStopCost (TileArea tile_area, DoCommandFlags flags, bool is_drive_through, StationType station_type, const RoadStopSpec *roadstopspec, Axis axis, DiagDirection ddir, StationID *station, RoadType rt, Money unit_cost) |
| Calculates cost of new road stops within the area. | |
| CommandCost | CmdBuildRoadStop (DoCommandFlags flags, TileIndex tile, uint8_t width, uint8_t length, RoadStopType stop_type, bool is_drive_through, DiagDirection ddir, RoadType rt, RoadStopClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent) |
| Build a bus or truck stop. | |
| static CommandCost | RemoveGenericRoadStop (DoCommandFlags flags, const TileArea &roadstop_area, bool road_waypoint, bool remove_road) |
| Remove a tile area of road stop or road waypoints. | |
| CommandCost | CmdRemoveRoadStop (DoCommandFlags flags, TileIndex tile, uint8_t width, uint8_t height, RoadStopType stop_type, bool remove_road) |
| Remove bus or truck stops. | |
| CommandCost | CmdRemoveFromRoadWaypoint (DoCommandFlags flags, TileIndex start, TileIndex end) |
| Remove road waypoints. | |
| uint8_t | GetAirportNoiseLevelForDistance (const AirportSpec *as, uint distance) |
| Get a possible noise reduction factor based on distance from town center. | |
| Town * | AirportGetNearestTown (const AirportSpec *as, Direction rotation, TileIndex tile, TileIterator &&it, uint &mindist) |
| Finds the town nearest to given airport. | |
| static Town * | AirportGetNearestTown (const Station *st, uint &mindist) |
| Finds the town nearest to given existing airport. | |
| void | UpdateAirportsNoise () |
| Recalculate the noise generated by the airports of each town. | |
| CommandCost | CmdBuildAirport (DoCommandFlags flags, TileIndex tile, uint8_t airport_type, uint8_t layout, StationID station_to_join, bool allow_adjacent) |
| Place an Airport. | |
| static CommandCost | RemoveAirport (TileIndex tile, DoCommandFlags flags) |
| Remove an airport. | |
| CommandCost | CmdOpenCloseAirport (DoCommandFlags flags, StationID station_id) |
| Open/close an airport to incoming aircraft. | |
| bool | HasStationInUse (StationID station, bool include_company, CompanyID company) |
| Tests whether the company's vehicles have this station in orders. | |
| CommandCost | CmdBuildDock (DoCommandFlags flags, TileIndex tile, StationID station_to_join, bool adjacent) |
| Build a dock/haven. | |
| void | RemoveDockingTile (TileIndex t) |
| void | ClearDockingTilesCheckingNeighbours (TileIndex tile) |
| Clear docking tile status from tiles around a removed dock, if the tile has no neighbours which would keep it as a docking tile. | |
| static TileIndex | FindDockLandPart (TileIndex t) |
| Find the part of a dock that is land-based. | |
| static CommandCost | RemoveDock (TileIndex tile, DoCommandFlags flags) |
| Remove a dock. | |
| const DrawTileSprites * | GetStationTileLayout (StationType st, uint8_t gfx) |
| Get station tile layout for a station type and its station gfx. | |
| bool | SplitGroundSpriteForOverlay (const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset) |
| Check whether a sprite is a track sprite, which can be replaced by a non-track ground sprite and a rail overlay. | |
| static BridgePillarFlags | GetStationBlockedPillars (std::span< const BridgeableTileInfo > bridgeable_info, uint8_t layout) |
| Get blocked pillar information for a station tile. | |
| static bool | DrawCustomStationFoundations (const StationSpec *statspec, BaseStation *st, TileInfo *ti, StationGfx gfx) |
| Draw custom station foundations for a NewGRF station if provided. | |
| static void | DrawTile_Station (TileInfo *ti) |
| Tile callback function signature for drawing a tile and its contents to the screen. | |
| void | StationPickerDrawSprite (int x, int y, StationType st, RailType railtype, RoadType roadtype, int image) |
| static void | FillTileDescRoadStop (TileIndex tile, TileDesc &td) |
| void | FillTileDescRailStation (TileIndex tile, TileDesc &td) |
| void | FillTileDescAirport (TileIndex tile, TileDesc &td) |
| static void | GetTileDesc_Station (TileIndex tile, TileDesc &td) |
| Tile callback function signature for obtaining a tile description. | |
| static TrackStatus | GetTileTrackStatus_Station (TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) |
| Tile callback function signature for getting the possible tracks that can be taken on a given tile by a given transport. | |
| static void | TileLoop_Station (TileIndex tile) |
| Tile callback function signature for running periodic tile updates. | |
| static void | AnimateTile_Station (TileIndex tile) |
| Tile callback function signature for animating a tile. | |
| static bool | ClickTile_Station (TileIndex tile) |
| Tile callback function signature for clicking a tile. | |
| static VehicleEnterTileStates | VehicleEnterTile_Station (Vehicle *v, TileIndex tile, int x, int y) |
| Tile callback function for a vehicle entering a tile. | |
| void | TriggerWatchedCargoCallbacks (Station *st) |
| Run the watched cargo callback for all houses in the catchment area. | |
| static bool | StationHandleBigTick (BaseStation *st) |
| This function is called for each station once every 250 ticks. | |
| static void | byte_inc_sat (uint8_t *p) |
| static void | TruncateCargo (const CargoSpec *cs, GoodsEntry *ge, uint amount=UINT_MAX) |
| Truncate the cargo by a specific amount. | |
| static void | UpdateStationRating (Station *st) |
| Periodic update of a station's rating. | |
| void | RerouteCargo (Station *st, CargoType cargo, StationID avoid, StationID avoid2) |
| Reroute cargo of type c at station st or in any vehicles unloading there. | |
| void | DeleteStaleLinks (Station *from) |
| Check all next hops of cargo packets in this station for existence of a a valid link they may use to travel on. | |
| void | IncreaseStats (Station *st, CargoType cargo, StationID next_station_id, uint capacity, uint usage, uint32_t time, EdgeUpdateModes modes) |
| Increase capacity for a link stat given by station cargo and next hop. | |
| void | IncreaseStats (Station *st, const Vehicle *front, StationID next_station_id, uint32_t time) |
| Increase capacity for all link stats associated with vehicles in the given consist. | |
| static void | StationHandleSmallTick (BaseStation *st) |
| void | OnTick_Station () |
| void | ModifyStationRatingAround (TileIndex tile, Owner owner, int amount, uint radius) |
| Forcibly modify station ratings near a given tile. | |
| static uint | UpdateStationWaiting (Station *st, CargoType cargo, uint amount, Source source) |
| static bool | IsUniqueStationName (const std::string &name) |
| CommandCost | CmdRenameStation (DoCommandFlags flags, StationID station_id, const std::string &text) |
| Rename a station. | |
| std::tuple< CommandCost, StationID > | CmdMoveStationName (DoCommandFlags flags, StationID station_id, TileIndex tile) |
| Move a station name. | |
| void | CcMoveStationName (Commands, const CommandCost &result, StationID station_id) |
| Callback function that is called after a name is moved. | |
| static void | AddNearbyStationsByCatchment (TileIndex tile, StationList &stations, StationList &nearby) |
| static bool | CanMoveGoodsToStation (const Station *st, CargoType cargo) |
| uint | MoveGoodsToStation (CargoType cargo, uint amount, Source source, const StationList &all_stations, Owner exclusivity) |
| void | UpdateStationDockingTiles (Station *st) |
| void | BuildOilRig (TileIndex tile) |
| void | DeleteOilRig (TileIndex tile) |
| static void | ChangeTileOwner_Station (TileIndex tile, Owner old_owner, Owner new_owner) |
| Tile callback function signature for changing the owner of a tile. | |
| static CommandCost | CanRemoveRoadWithStop (TileIndex tile, DoCommandFlags flags) |
| Check if a drive-through road stop tile can be cleared. | |
| static CommandCost | TerraformTile_Station (TileIndex tile, DoCommandFlags flags, int z_new, Slope tileh_new) |
| Tile callback function signature of the terraforming callback. | |
| static CommandCost | CheckBuildAbove_Station (TileIndex tile, DoCommandFlags flags, Axis axis, int height) |
| Tile callback function signature to test if a bridge can be built above a tile. | |
Variables | |
| static const TileIndexDiffC | _dock_tileoffs_chkaround [] |
| static const uint8_t | _dock_w_chk [4] = { 2, 1, 2, 1 } |
| static const uint8_t | _dock_h_chk [4] = { 1, 2, 1, 2 } |
| static const IntervalTimer< TimerGameEconomy > | _economy_stations_monthly ({TimerGameEconomy::Trigger::Month, TimerGameEconomy::Priority::Station}, [](auto) { for(Station *st :Station::Iterate()) { for(GoodsEntry &ge :st->goods) { ge.status.Set(GoodsEntry::State::LastMonth, ge.status.Test(GoodsEntry::State::CurrentMonth));ge.status.Reset(GoodsEntry::State::CurrentMonth);} } }) |
| Economy monthly loop for stations. | |
| const TileTypeProcs | _tile_type_station_procs |
| TileTypeProcs definitions for TileType::Station tiles. | |
Handling of station tiles.
Definition in file station_cmd.cpp.
| typedef bool(* CMSAMatcher) (TileIndex tile) |
Function to check whether the given tile matches some criterion.
| tile | the tile to check |
Definition at line 149 of file station_cmd.cpp.
| enum StationNaming : uint8_t |
Station types a station could be named after.
| Enumerator | |
|---|---|
| Rail | Railway station. |
| Road | Truck or bus stop. |
| Airport | Airport for fixed wing aircraft. |
| Oilrig | Heliport of an oilrig. |
| Dock | Ship dock. |
| Heliport | Standalone heliport. |
Definition at line 219 of file station_cmd.cpp.
|
static |
Definition at line 4571 of file station_cmd.cpp.
| Town * AirportGetNearestTown | ( | const AirportSpec * | as, |
| Direction | rotation, | ||
| TileIndex | tile, | ||
| TileIterator && | it, | ||
| uint & | mindist ) |
Finds the town nearest to given airport.
Based on minimal manhattan distance to any airport's tile. If two towns have the same distance, town with lower index is returned.
| as | airport's description | |
| rotation | airport's rotation | |
| tile | origin tile (top corner of the airport) | |
| it | An iterator over all airport tiles (consumed) | |
| [out] | mindist | Minimum distance to town |
Definition at line 2576 of file station_cmd.cpp.
References CalcClosestTownFromTile(), DIR_E, DIR_W, DistanceManhattan(), INVALID_TILE, IsInsideBS(), AirportSpec::size_x, AirportSpec::size_y, TileX(), TileY(), and Town::xy.
Referenced by AirportGetNearestTown(), CmdBuildAirport(), RemoveAirport(), and UpdateAirportsNoise().
Finds the town nearest to given existing airport.
Based on minimal manhattan distance to any airport's tile. If two towns have the same distance, town with lower index is returned.
| st | Existing station with airport. | |
| [out] | mindist | Minimum distance to town |
Definition at line 2619 of file station_cmd.cpp.
References Station::airport, AirportGetNearestTown(), Airport::GetSpec(), Airport::rotation, and OrthogonalTileArea::tile.
|
static |
Tile callback function signature for animating a tile.
| tile | The tile to animate. |
Definition at line 3824 of file station_cmd.cpp.
References HasStationRail(), IsAirport(), and IsAnyRoadStopTile().
| void BuildOilRig | ( | TileIndex | tile | ) |
Definition at line 4733 of file station_cmd.cpp.
|
static |
Common part of building various station parts and possibly attaching them to an existing one.
| [in,out] | st | Station to attach to |
| flags | Command flags | |
| reuse | Whether to try to reuse a deleted station (gray sign) if possible | |
| area | Area occupied by the new part | |
| name_class | Station naming class to use to generate the new station's name |
Definition at line 705 of file station_cmd.cpp.
References _current_company, ClosestTownFromTile(), CMD_ERROR, SpecializedStation< Station, false >::Create(), Execute, CommandCost::Failed(), GenerateStationName(), GetClosestDeletedStation(), OrthogonalTileArea::h, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, and OrthogonalTileArea::w.
Referenced by CmdBuildAirport(), CmdBuildDock(), CmdBuildRailStation(), and CmdBuildRoadStop().
|
inlinestatic |
Definition at line 3960 of file station_cmd.cpp.
|
static |
Calculates cost of new rail stations within the area.
| tile_area | Area to check. |
| flags | Operation to perform. |
| axis | Rail station axis. |
| station | StationID to be queried and returned if available. |
| rt | The rail type to check for (overbuilding rail stations over rail). |
| affected_vehicles | List of trains with PBS reservations on the tiles |
| spec_class | Station class. |
| spec_index | Index into the station class. |
| plat_len | Platform length. |
| numtracks | Number of platforms. |
Definition at line 1382 of file station_cmd.cpp.
References _price, CommandCost::AddCost(), BuildStationRail, BuildStationRailLength, CheckFlatLandRailStation(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), GetRailStationAxis(), IsRailStationTile(), RailBuildCost(), and OrthogonalTileArea::tile.
Referenced by CmdBuildRailStation().
| CommandCost CalculateRoadStopCost | ( | TileArea | tile_area, |
| DoCommandFlags | flags, | ||
| bool | is_drive_through, | ||
| StationType | station_type, | ||
| const RoadStopSpec * | roadstopspec, | ||
| Axis | axis, | ||
| DiagDirection | ddir, | ||
| StationID * | station, | ||
| RoadType | rt, | ||
| Money | unit_cost ) |
Calculates cost of new road stops within the area.
| tile_area | Area to check. |
| flags | Operation to perform. |
| is_drive_through | True if trying to build a drive-through station. |
| station_type | Station type (bus, truck or road waypoint). |
| roadstopspec | Spec of road stop being built. |
| axis | Axis of a drive-through road stop. |
| ddir | Entrance direction (DiagDirection) for normal stops. Converted to the axis for drive-through stops. |
| station | StationID to be queried and returned if available. |
| rt | Road type to build, may be INVALID_ROADTYPE if an existing road is required. |
| unit_cost | The cost to build one road stop of the current type. |
Definition at line 2046 of file station_cmd.cpp.
References CommandCost::AddCost(), AxisToDiagDir(), CheckFlatLandRoadStop(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), IsAnyRoadStop(), IsTileType(), ReverseDiagDir(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), and Station.
Referenced by CmdBuildRoadStop(), and CmdBuildRoadWaypoint().
| CommandCost CanExpandRailStation | ( | const BaseStation * | st, |
| TileArea & | new_ta ) |
Check whether we can expand the rail part of the given station.
| st | the station to expand |
| new_ta | the current (and if all is fine new) tile area of the rail part of the station |
Definition at line 1210 of file station_cmd.cpp.
References _settings_game, OrthogonalTileArea::h, OrthogonalTileArea::tile, TileX(), TileXY(), TileY(), BaseStation::train_station, and OrthogonalTileArea::w.
Referenced by CmdBuildRailStation(), and CmdBuildRailWaypoint().
Definition at line 4601 of file station_cmd.cpp.
|
static |
Check if a drive-through road stop tile can be cleared.
Road stops built on town-owned roads check the conditions that would allow clearing of the original road.
| tile | The road stop tile to check. |
| flags | Command flags. |
Definition at line 4892 of file station_cmd.cpp.
References _current_company, CheckAllowRemoveRoad(), CheckOwnership(), CommandCost::Failed(), GetAnyRoadBits(), GetRoadOwner(), GetRoadTypeRoad(), GetRoadTypeTram(), INVALID_ROADTYPE, OWNER_NONE, OWNER_TOWN, OWNER_WATER, RTT_ROAD, and RTT_TRAM.
Referenced by ClearTile_Station().
| void CcMoveStationName | ( | Commands | , |
| const CommandCost & | result, | ||
| StationID | station_id ) |
Callback function that is called after a name is moved.
| result | of the operation |
| station_id | ID of the changed station |
Definition at line 4562 of file station_cmd.cpp.
References CommandCost::Failed(), SpecializedStation< Station, false >::Get(), ResetObjectToPlace(), and SetViewportStationRect().
Referenced by QueryStringWindow::OnPlaceObject().
|
static |
Tile callback function signature for changing the owner of a tile.
| tile | The tile to process. |
| old_owner | The owner to replace. |
| new_owner | The owner to replace with. |
Definition at line 4799 of file station_cmd.cpp.
References Bankrupt, Buoy, Bus, Canal, ChangeTileOwner(), Dock, Execute, GetRailType(), GetRoadOwner(), GetRoadType(), GetStationType(), GetWaterClass(), Company::infrastructure, INVALID_OWNER, INVALID_ROADTYPE, InvalidateWindowClassesData(), IsAirport(), IsAnyRoadStopTile(), IsBuoy(), IsBuoyTile(), IsDriveThroughStopTile(), IsRoadWaypoint(), IsStationTileBlocked(), IsTileOwner(), IsTileType(), OWNER_NONE, Rail, CompanyInfrastructure::rail, RailWaypoint, Road, RoadWaypoint, SetRoadOwner(), SetTileOwner(), CompanyInfrastructure::station, Truck, Water, CompanyInfrastructure::water, and WC_STATION_LIST.
| CommandCost CheckBuildableTile | ( | TileIndex | tile, |
| DiagDirections | invalid_dirs, | ||
| int & | allowed_z, | ||
| bool | allow_steep, | ||
| bool | check_bridge = true ) |
Checks if the given tile is buildable, flat and has a certain height.
| tile | TileIndex to check. |
| invalid_dirs | Prohibited directions for slopes (set of DiagDirection). |
| allowed_z | Height allowed for the tile. If allowed_z is negative, it will be set to the height of this tile. |
| allow_steep | Whether steep slopes are allowed. |
| check_bridge | Check for the existence of a bridge. |
Definition at line 807 of file station_cmd.cpp.
References _price, _settings_game, CommandCost::AddCost(), BuildFoundation, CanBuildDepotByTileh(), DIAGDIR_BEGIN, DIAGDIR_END, EnsureNoVehicleOnGround(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), GetSlopeMaxZ(), GetTileSlopeZ(), IsBridgeAbove(), IsSteepSlope(), SLOPE_FLAT, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
Referenced by CheckFlatLandAirport(), CheckFlatLandRailStation(), CheckFlatLandRoadStop(), and CmdBuildObject().
|
static |
Tile callback function signature to test if a bridge can be built above a tile.
| tile | The involved tile. |
| flags | Command flags passed to the build command. |
| axis | Axis of bridge being built. |
| height | Absolute height of bridge platform. |
Definition at line 5386 of file station_cmd.cpp.
References StationSpec::bridgeable_info, Bus, GetStationBridgeableTileInfo(), GetStationGfx(), GetStationType(), IsStationBridgeAboveOk(), Rail, RailWaypoint, RoadWaypoint, and Truck.
|
static |
Checks if an airport can be built at the given location and clear the area.
| tile_iter | Airport tile iterator. |
| flags | Operation to perform. |
Definition at line 856 of file station_cmd.cpp.
References CommandCost::AddCost(), CheckBuildableTile(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), and INVALID_TILE.
Referenced by CmdBuildAirport().
|
static |
Checks if a rail station can be built at the given tile.
| tile_cur | Tile to check. |
| north_tile | North tile of the area being checked. |
| allowed_z | Height allowed for the tile. If allowed_z is negative, it will be set to the height of this tile. |
| flags | Operation to perform. |
| axis | Rail station axis. |
| station | StationID to be queried and returned if available. |
| rt | The rail type to check for (overbuilding rail stations over rail). |
| affected_vehicles | List of trains with PBS reservations on the tiles |
| spec_class | Station class. |
| spec_index | Index into the station class. |
| plat_len | Platform length. |
| numtracks | Number of platforms. |
Definition at line 1011 of file station_cmd.cpp.
References CommandCost::AddCost(), Auto, AxisToDiagDirs(), StationSpec::callback_mask, CheckBuildableTile(), ClearTile_Station(), DIAGDIR_NE, EXPENSES_CONSTRUCTION, CommandCost::Failed(), NewGRFClass< StationSpec, StationClassID >::Get(), CommandCost::GetCost(), GetRailReservationTrackBits(), GetRailType(), NewGRFClass< Tspec, Tindex >::GetSpec(), GetStationIndex(), GetTrackBits(), GetTrainForReservation(), HasBit(), HasPowerOnRail(), HasSignals(), INVALID_RAILTYPE, IsPlainRailTile(), IsRailStation(), IsTileType(), PerformStationTileSlopeCheck(), RemoveFirstTrack(), SlopeCheck, Station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TRACK_BIT_NONE, TRACK_X, and TRACK_Y.
Referenced by CalculateRailStationCost().
|
static |
Checks if a road stop can be built at the given tile.
| cur_tile | Tile to check. |
| allowed_z | Height allowed for the tile. If allowed_z is negative, it will be set to the height of this tile. |
| spec | Spec of road stop to be built. |
| flags | Operation to perform. |
| invalid_dirs | Prohibited directions (set of DiagDirections). |
| is_drive_through | True if trying to build a drive-through station. |
| station_type | Station type (bus, truck or road waypoint). |
| axis | Axis of a drive-through road stop. |
| station | StationID to be queried and returned if available. |
| rt | Road type to build, may be INVALID_ROADTYPE if an existing road is required. |
Definition at line 1094 of file station_cmd.cpp.
References _settings_game, CommandCost::AddCost(), Auto, AXIS_X, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), CheckBuildableTile(), CheckOwnership(), ClearTile_Station(), CountBits(), DRD_NONE, EXPENSES_CONSTRUCTION, CommandCost::Failed(), FindFirstBit(), GetAllRoadBits(), CommandCost::GetCost(), GetDisallowedRoadDirections(), GetDriveThroughStopAxis(), GetRoadBits(), GetRoadOwner(), GetRoadType(), GetStationIndex(), GetStationType(), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET, HasExactlyOneBit(), HasPowerOnRoad(), INVALID_ROADTYPE, IsAnyRoadStop(), IsDriveThroughStopTile(), IsNormalRoadTile(), IsRoadStationBridgeAboveOk(), IsTileType(), OWNER_NONE, OWNER_TOWN, ROAD_NONE, ROAD_X, ROAD_Y, RoadBuildCost(), RTT_ROAD, RTT_TRAM, and Station.
Referenced by CalculateRoadStopCost().
| void ClearAllStationCachedNames | ( | ) |
Definition at line 495 of file station_cmd.cpp.
| void ClearDockingTilesCheckingNeighbours | ( | TileIndex | tile | ) |
Clear docking tile status from tiles around a removed dock, if the tile has no neighbours which would keep it as a docking tile.
| tile | Ex-dock tile to check. |
Definition at line 3024 of file station_cmd.cpp.
References CheckForDockingTile(), DIAGDIR_BEGIN, DIAGDIR_END, IsPossibleDockingTile(), IsValidTile(), SetDockingTile(), and TileOffsByDiagDir().
Referenced by RemoveDock(), and Industry::~Industry().
| CommandCost ClearTile_Station | ( | TileIndex | tile, |
| DoCommandFlags | flags ) |
Tile callback function signature for clearing a tile.
| tile | The tile to clear. |
| flags | The command flags. |
Definition at line 4922 of file station_cmd.cpp.
References Airport, Auto, Buoy, Bus, CanRemoveRoadWithStop(), CMD_ERROR, CommandCostWithParam(), Dock, CommandCost::Failed(), GetStationType(), HasTileRoadType(), IsDriveThroughStopTile(), Oilrig, Rail, RailWaypoint, RemoveAirport(), RemoveBuoy(), RemoveDock(), RemoveRailStation(), RemoveRailWaypoint(), RemoveRoadStop(), RemoveRoadWaypointStop(), RoadWaypoint, RTT_TRAM, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and Truck.
Referenced by CheckFlatLandRailStation(), CheckFlatLandRoadStop(), and IsValidTileForWaypoint().
|
static |
Tile callback function signature for clicking a tile.
| tile | The tile that was clicked. |
Definition at line 3844 of file station_cmd.cpp.
References Station::airport, BaseStation::facilities, SpecializedStation< Station, false >::From(), SpecializedStation< Waypoint, true >::From(), BaseStation::GetByTile(), Airport::GetHangarNum(), Airport::GetHangarTile(), IsHangar(), ShowDepotWindow(), ShowStationViewWindow(), ShowWaypointWindow(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), VEH_AIRCRAFT, and Waypoint.
| CommandCost CmdBuildAirport | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| uint8_t | airport_type, | ||
| uint8_t | layout, | ||
| StationID | station_to_join, | ||
| bool | allow_adjacent ) |
Place an Airport.
| flags | operation to perform |
| tile | tile where airport will be built |
| airport_type | airport type, |
| layout | airport layout |
| station_to_join | station ID to join (NEW_STATION if build new one) |
| allow_adjacent | allow airports directly adjacent to other airports. |
Definition at line 2649 of file station_cmd.cpp.
References _price, _settings_game, OrthogonalTileArea::Add(), AddAnimatedTile(), CommandCost::AddCost(), Station::AddFacility(), Station::AfterStationTileSetChange(), AirportFTAClass::Airplanes, Airport, Station::airport, AirportGetNearestTown(), AT_OILRIG, Airport::blocks, BuildStationAirport, BuildStationPart(), Built, CheckFlatLandAirport(), CheckIfAuthorityAllowsNewStation(), ClosestTownFromTile(), CMD_ERROR, CommandCostWithParam(), DIR_E, DIR_W, Execute, BaseStation::facilities, CommandCost::Failed(), FindJoiningStation(), GB(), AirportSpec::Get(), AirportTileSpec::Get(), GetAirport(), GetAirportNoiseLevelForDistance(), SpecializedStation< Station, false >::GetIfValid(), GetTranslatedAirportTileID(), Heliport, Invalid, INVALID_TILE, InvalidateWindowData(), AirportSpec::IsAvailable(), SpecializedStation< Station, false >::IsValidID(), AirportSpec::IsWithinMapBounds(), SpecializedStation< Station, false >::Iterate(), Airport::layout, RailStationTileLayout::layout, AirportSpec::layouts, MakeAirport(), Town::MaxTownNoise(), NoAnimation, Town::noise_reached, NUM_AIRPORTS, BaseStation::owner, BaseStation::rect, Airport::rotation, SetStationTileRandomBits(), SetWindowDirty(), AirportSpec::size_x, AirportSpec::size_y, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, BaseStation::town, Airport::type, UpdateAirplanesOnNewStation(), WC_STATION_VIEW, and WC_TOWN_VIEW.
| CommandCost CmdBuildDock | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| StationID | station_to_join, | ||
| bool | adjacent ) |
Build a dock/haven.
| flags | operation to perform |
| tile | tile where dock will be built |
| station_to_join | station ID to join (NEW_STATION if build new one) |
| adjacent | allow docks directly adjacent to other docks. |
Definition at line 2915 of file station_cmd.cpp.
References _current_company, _price, _settings_game, OrthogonalTileArea::Add(), CommandCost::AddCost(), Station::AddFacility(), Station::AfterStationTileSetChange(), BuildStationDock, BuildStationPart(), Canal, CheckIfAuthorityAllowsNewStation(), CMD_ERROR, DiagDirToAxis(), Dock, Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), FindJoiningStation(), CommandCost::GetCost(), SpecializedStation< Station, false >::GetIfValid(), GetInclinedSlopeDirection(), GetTileSlope(), GetWaterClass(), GFX_DOCK_BASE_WATER_PART, OrthogonalTileArea::h, HasTileWaterClass(), HasTileWaterGround(), INVALID_DIAGDIR, IsDockBridgeAboveOk(), IsTileFlat(), IsTileOwner(), IsTileType(), SpecializedStation< Station, false >::IsValidID(), IsWaterTile(), MakeDock(), BaseStation::owner, BaseStation::rect, ReverseDiagDir(), Station::ship_station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, TileOffsByDiagDir(), to_underlying(), ToTileIndexDiff(), OrthogonalTileArea::w, and Water.
| CommandCost CmdBuildRailStation | ( | DoCommandFlags | flags, |
| TileIndex | tile_org, | ||
| RailType | rt, | ||
| Axis | axis, | ||
| uint8_t | numtracks, | ||
| uint8_t | plat_len, | ||
| StationClassID | spec_class, | ||
| uint16_t | spec_index, | ||
| StationID | station_to_join, | ||
| bool | adjacent ) |
Build rail station.
| flags | operation to perform |
| tile_org | northern most position of station dragging/placement |
| rt | railtype |
| axis | orientation (Axis) |
| numtracks | number of tracks |
| plat_len | platform length |
| spec_class | custom station class |
| spec_index | custom station id |
| station_to_join | station ID to join (NEW_STATION if build new one) |
| adjacent | allow stations directly adjacent to other stations. |
Definition at line 1457 of file station_cmd.cpp.
References _current_company, _settings_game, Station::AddFacility(), AddTrackToSignalBuffer(), Station::AfterStationTileSetChange(), AllocateSpecToStation(), AssignSpecToStation(), Avail, AXIS_X, AxisToDiagDir(), AxisToTrack(), BuildStationPart(), Built, BaseStation::cached_anim_triggers, CalculateRailStationCost(), CALLBACK_FAILED, StationSpec::callback_mask, CanExpandRailStation(), CBID_STATION_AVAILABILITY, CBID_STATION_BUILD_TILE_LAYOUT, CheckIfAuthorityAllowsNewStation(), CMD_ERROR, Convert8bitBooleanCallback(), DeallocateSpecFromStation(), DeleteAnimatedTile(), DeleteNewGRFInspectWindow(), StationSpec::disallowed_lengths, StationSpec::disallowed_platforms, ErrorUnknownCallbackResult(), Execute, CommandCost::Failed(), FindJoiningStation(), FreeTrainReservation(), GB(), NewGRFClass< StationSpec, StationClassID >::Get(), NewGRFClass< StationSpec, StationClassID >::GetClassCount(), GetCustomStationSpecIndex(), GetPlatformInfo(), GetRailStationAxis(), GetRailType(), NewGRFClass< Tspec, Tindex >::GetSpec(), NewGRFClass< Tspec, Tindex >::GetSpecCount(), GetStationGfx(), GetTrainForReservation(), StationSpec::grf_prop, GRFFilePropsBase::grffile, GRFFilePropsBase::grfid, HasBit(), HasStationReservation(), HasStationTileRail(), Company::infrastructure, INVALID_TILE, IsBridgeAbove(), IsCompatibleTrainStationTile(), IsRailStationBridgeAboveOk(), IsRailStationTile(), IsStationTileBlocked(), IsValidAxis(), SpecializedStation< Station, false >::IsValidID(), IsValidTile(), IsWaypointClass(), MakeRailStation(), Station::MarkTilesDirty(), OtherAxis(), BaseStation::owner, Rail, CompanyInfrastructure::rail, BaseStation::rect, RestoreTrainReservation(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), SetAnimationFrame(), SetCustomStationSpecIndex(), SetRailStationPlatformReservation(), SetRailStationTileFlags(), SetStationGfx(), SetStationTileRandomBits(), CompanyInfrastructure::station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, TileAddWrap(), TileOffsByAxis(), TileOffsByDiagDir(), Train, BaseStation::train_station, ValParamRailType(), and YapfNotifyTrackLayoutChange().
| CommandCost CmdBuildRoadStop | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| uint8_t | width, | ||
| uint8_t | length, | ||
| RoadStopType | stop_type, | ||
| bool | is_drive_through, | ||
| DiagDirection | ddir, | ||
| RoadType | rt, | ||
| RoadStopClassID | spec_class, | ||
| uint16_t | spec_index, | ||
| StationID | station_to_join, | ||
| bool | adjacent ) |
Build a bus or truck stop.
| flags | Operation to perform. |
| tile | Northernmost tile of the stop. |
| width | Width of the road stop. |
| length | Length of the road stop. |
| stop_type | Type of road stop (bus/truck). |
| is_drive_through | False for normal stops, true for drive-through. |
| ddir | Entrance direction (DiagDirection) for normal stops. Converted to the axis for drive-through stops. |
| rt | The roadtype. |
| spec_class | Road stop spec class. |
| spec_index | Road stop spec index. |
| station_to_join | Station ID to join (NEW_STATION if build new one). |
| adjacent | Allow stations directly adjacent to other stations. |
Definition at line 2091 of file station_cmd.cpp.
References _current_company, _price, _settings_game, OrthogonalTileArea::Add(), Station::AddFacility(), Station::AfterStationTileSetChange(), AllocateSpecToRoadStop(), AssignSpecToRoadStop(), Avail, BuildStationBus, BuildStationPart(), BuildStationTruck, Built, Bus, Station::bus_station, BusStop, BaseStation::cached_roadstop_anim_triggers, CalculateRoadStopCost(), CALLBACK_FAILED, CBID_STATION_AVAILABILITY, CheckIfAuthorityAllowsNewStation(), CMD_ERROR, Convert8bitBooleanCallback(), CountBits(), DiagDirToAxis(), DriveThroughOnly, End, Execute, CommandCost::Failed(), FindJoiningRoadStop(), FindRoadStopSpot(), GB(), NewGRFClass< RoadStopSpec, RoadStopClassID >::Get(), RoadStopSpec::GetBuildCost(), NewGRFClass< RoadStopSpec, RoadStopClassID >::GetClassCount(), GetRoadBits(), GetRoadOwner(), GetRoadType(), NewGRFClass< Tspec, Tindex >::GetSpec(), NewGRFClass< Tspec, Tindex >::GetSpecCount(), RoadStopSpec::grf_prop, GRFFilePropsBase::grffile, OrthogonalTileArea::h, INVALID_ROADTYPE, INVALID_TILE, IsNormalRoadTile(), IsStationRoadStop(), IsTileType(), IsValidDiagDirection(), SpecializedStation< Station, false >::IsValidID(), IsValidTile(), IsWaypointClass(), RailStationTileLayout::length, RoadStop::MakeDriveThrough(), MakeDriveThroughRoadStop(), MakeRoadStop(), MarkTileDirtyByTile(), MayHaveRoad(), BaseStation::owner, BaseStation::rect, RemoveRoadStop(), Road, ROAD_STOP_TRACKBIT_FACTOR, ROADSTOPTYPE_ALL, ROADSTOPTYPE_FREIGHT, ROADSTOPTYPE_PASSENGER, RTT_ROAD, RTT_TRAM, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), SetCustomRoadStopSpecIndex(), Station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileAddWrap(), Truck, Station::truck_station, TruckStop, UpdateCompanyRoadInfrastructure(), ValParamRoadType(), and OrthogonalTileArea::w.
| std::tuple< CommandCost, StationID > CmdMoveStationName | ( | DoCommandFlags | flags, |
| StationID | station_id, | ||
| TileIndex | tile ) |
Move a station name.
| flags | type of operation |
| station_id | id of the station |
| tile | to move the station name to |
Definition at line 4525 of file station_cmd.cpp.
References CheckOwnership(), CMD_ERROR, Execute, CommandCost::Failed(), ForAllStationsRadius(), SpecializedStation< Station, false >::GetIfValid(), Station::MoveSign(), BaseStation::owner, OWNER_NONE, StationRect::PtInExtendedRect(), BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileX(), TileY(), Station::UpdateVirtCoord(), and BaseStation::xy.
| CommandCost CmdOpenCloseAirport | ( | DoCommandFlags | flags, |
| StationID | station_id ) |
Open/close an airport to incoming aircraft.
| flags | Operation to perform. |
| station_id | Station ID of the airport. |
Definition at line 2858 of file station_cmd.cpp.
References Airport, Station::airport, AirportClosed, Airport::blocks, CheckOwnership(), CMD_ERROR, Execute, BaseStation::facilities, CommandCost::Failed(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Flip(), SpecializedStation< Station, false >::Get(), SpecializedStation< Station, false >::IsValidID(), BaseStation::owner, OWNER_NONE, SetWindowWidgetDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), WC_STATION_VIEW, and WID_SV_CLOSE_AIRPORT.
| CommandCost CmdRemoveFromRailStation | ( | DoCommandFlags | flags, |
| TileIndex | start, | ||
| TileIndex | end, | ||
| bool | keep_rail ) |
Remove a single tile from a rail station.
This allows for custom-built station with holes and weird layouts
| flags | operation to perform |
| start | tile of station piece to remove |
| end | other edge of the rect to remove |
| keep_rail | if set keep the rail |
Definition at line 1875 of file station_cmd.cpp.
References _price, ClearStationRail, CMD_ERROR, CommandCost::Failed(), INVALID_TILE, RemoveFromRailBaseStation(), SetWindowWidgetDirty(), Map::Size(), OrthogonalTileArea::tile, BaseStation::train_station, WC_STATION_VIEW, and WID_SV_TRAINS.
| CommandCost CmdRemoveFromRailWaypoint | ( | DoCommandFlags | flags, |
| TileIndex | start, | ||
| TileIndex | end, | ||
| bool | keep_rail ) |
Remove a single tile from a waypoint.
This allows for custom-built waypoint with holes and weird layouts
| flags | operation to perform |
| start | tile of waypoint piece to remove |
| end | other edge of the rect to remove |
| keep_rail | if set keep the rail |
Definition at line 1908 of file station_cmd.cpp.
References _price, ClearWaypointRail, CMD_ERROR, RemoveFromRailBaseStation(), and Map::Size().
| CommandCost CmdRemoveFromRoadWaypoint | ( | DoCommandFlags | flags, |
| TileIndex | start, | ||
| TileIndex | end ) |
Remove road waypoints.
| flags | operation to perform |
| start | tile of road waypoint piece to remove |
| end | other edge of the rect to remove |
Definition at line 2527 of file station_cmd.cpp.
References CMD_ERROR, RemoveGenericRoadStop(), and Map::Size().
| CommandCost CmdRemoveRoadStop | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| uint8_t | width, | ||
| uint8_t | height, | ||
| RoadStopType | stop_type, | ||
| bool | remove_road ) |
Remove bus or truck stops.
| flags | Operation to perform. |
| tile | Northernmost tile of the removal area. |
| width | Width of the removal area. |
| height | Height of the removal area. |
| stop_type | Type of stop (bus/truck). |
| remove_road | Remove roads of drive-through stops? |
Definition at line 2505 of file station_cmd.cpp.
References Bankrupt, CMD_ERROR, End, INVALID_TILE, IsValidTile(), RemoveGenericRoadStop(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and TileAddWrap().
| CommandCost CmdRenameStation | ( | DoCommandFlags | flags, |
| StationID | station_id, | ||
| const std::string & | text ) |
Rename a station.
| flags | operation to perform |
| station_id | station ID that is to be renamed |
| text | the new name or an empty string when resetting to the default |
Definition at line 4488 of file station_cmd.cpp.
References BaseStation::cached_name, CheckOwnership(), CMD_ERROR, Execute, CommandCost::Failed(), SpecializedStation< Station, false >::GetIfValid(), InvalidateWindowData(), MAX_LENGTH_STATION_NAME_CHARS, BaseStation::name, BaseStation::owner, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Station::UpdateVirtCoord(), Utf8StringLength(), and WC_STATION_LIST.
|
static |
Check whether the tile is a mine.
| tile | the tile to investigate. |
Definition at line 176 of file station_cmd.cpp.
References Extractive, CargoSpec::Get(), Industry::GetByTile(), GetIndustrySpec(), Industry, IsTileType(), IsValidCargoType(), IndustrySpec::life_type, Industry::produced, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and Industry::type.
Referenced by GenerateStationName().
|
static |
Check whether the tile is a tree.
| tile | the tile to investigate. |
Definition at line 213 of file station_cmd.cpp.
References IsTileType(), and Trees.
Referenced by GenerateStationName().
|
static |
Check whether the tile is water.
| tile | the tile to investigate. |
Definition at line 203 of file station_cmd.cpp.
References IsTileType(), IsWater(), and Water.
Referenced by GenerateStationName().
|
static |
Counts the numbers of tiles matching a specific type in the area around.
| tile | the center tile of the 'count area' |
| cmp | the comparator/matcher ( |
Definition at line 157 of file station_cmd.cpp.
References INVALID_TILE, and TileAddWrap().
Referenced by GenerateStationName().
| void DeleteOilRig | ( | TileIndex | tile | ) |
Definition at line 4782 of file station_cmd.cpp.
| void DeleteStaleLinks | ( | Station * | from | ) |
Check all next hops of cargo packets in this station for existence of a a valid link they may use to travel on.
Reroute any cargo not having a valid link and remove timed out links found like this from the linkgraph. We're not all links here as that is expensive and useless. A link no one is using doesn't hurt either.
| from | Station to check. |
Definition at line 4189 of file station_cmd.cpp.
References _settings_game, LinkGraph::COMPRESSION_INTERVAL, TimerGameEconomy::date, Vehicle::date_of_last_service, FlowStatMap::DeleteFlows(), DistanceManhattan(), GoodsEntry::GoodsEntryData::flows, SpecializedStation< Station, false >::Get(), GoodsEntry::GetData(), Station::goods, GoodsEntry::HasData(), TimerGameConst< struct Economy >::INVALID_DATE, Vehicle::IsStoppedInDepot(), LinkGraph::LastCompression(), GoodsEntry::link_graph, Manual, LinkGraph::MIN_TIMEOUT_DISTANCE, Vehicle::NextShared(), GoodsEntry::node, NUM_CARGO, RerouteCargo(), FlowStatMap::RestrictFlows(), LinkRefresher::Run(), LinkGraph::STALE_LINK_DEPOT_TIMEOUT, and BaseStation::xy.
|
static |
This is called right after a station was deleted.
It checks if the whole station is free of substations, and if so, the station will be deleted after a little while.
| st | Station |
Definition at line 742 of file station_cmd.cpp.
References BaseStation::delete_ctr, InvalidateWindowData(), BaseStation::IsInUse(), BaseStation::owner, and WC_STATION_LIST.
Referenced by Station::AfterStationTileSetChange(), RemoveFromRailBaseStation(), and RemoveRoadWaypointStop().
|
static |
Draw custom station foundations for a NewGRF station if provided.
| statspec | Custom NewGRF station. |
| st | Station being drawn. |
| ti | Tile being drawn. |
| gfx | Graphics layout for tile. |
Definition at line 3230 of file station_cmd.cpp.
References AddSortableSpriteToDraw(), CustomFoundations, ExtendedFoundations, StationSpec::flags, GetCustomStationFoundationRelocation(), GetFoundationPixelSlope(), SetBit(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileInfo::tile, and TileInfo::tileh.
Referenced by DrawTile_Station().
|
static |
Tile callback function signature for drawing a tile and its contents to the screen.
| ti | Information about the tile to draw |
Definition at line 3291 of file station_cmd.cpp.
References _settings_client, AXIS_X, AxisToRoadBits(), RailTypeInfo::base_sprites, RoadStopSpec::bridgeable_info, StationSpec::bridgeable_info, CALLBACK_FAILED, StationSpec::callback_mask, CBID_STATION_DRAW_TILE_LAYOUT, DrawBridgeMiddle(), DrawCustomStationFoundations(), DrawFoundation(), DrawGroundSprite(), DrawModeRegister, DrawRailCatenary(), DrawRailTileSeq(), DrawRoadCatenary(), DrawRoadGroundSprites(), DrawRoadOverlays(), DrawTileLayout, RailTypeInfo::fallback_railtype, StationSpec::flags, FOUNDATION_LEVELED, GB(), AirportTileSpec::Get(), GetAirportGfx(), GetAnimationFrame(), BaseStation::GetByTile(), GetCanalSprite(), GetCompanyPalette(), GetCustomRailSprite(), GetCustomRoadSprite(), GetCustomStationRelocation(), GetCustomStationSpecIndex(), GetDockDirection(), GetDriveThroughStopAxis(), SpriteLayoutProcessor::GetLayout(), GetRailStationAxis(), GetRailType(), GetRailTypeInfo(), RailTypeInfo::GetRailtypeSpriteOffset(), GetRoadTypeInfo(), GetRoadTypeRoad(), GetRoadTypeTram(), GetRoadWaypointRoadside(), GetStationBlockedPillars(), GetStationBridgeableTileInfo(), GetStationGfx(), GetStationTileLayout(), GetStationType(), GetTileOwner(), GetWaterClass(), AirportTileSpec::grf_prop, DrawTileSprites::ground, GroundSpritePaletteTransform(), HasBit(), HasRailCatenaryDrawn(), StandardGRFFileProps::HasSpriteGroups(), HasStationRail(), HasStationReservation(), HasTileWaterClass(), Invalid, INVALID_AIRPORTTILE, INVALID_ROADTYPE, IsAirport(), IsAnyRoadStop(), IsBuoy(), IsCustomStationSpecIndex(), IsDock(), IsDriveThroughStopTile(), IsOilRig(), IsRailWaypoint(), IsRoadWaypointOnSnowOrDesert(), IsRoadWaypointTile(), IsTileOnWater(), RailStationTileLayout::layout, NEW_AIRPORTTILE_OFFSET, NoCatenary, Overlay, PalSpriteID::pal, PALETTE_CRASH, StationSpec::renderdata, Road, ROAD_NONE, RoadWaypoint, ROTSG_ROADSTOP, RTSG_GROUND, RTSG_OVERLAY, Sea, SeparateGround, RailTypeInfo::single_x, RailTypeInfo::single_y, SLOPE_FLAT, BaseStation::speclist, SplitGroundSpriteForOverlay(), PalSpriteID::sprite, SPRITE_MODIFIER_CUSTOM_SPRITE, SPRITE_WIDTH, SubstituteGRFFileProps::subst_id, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileInfo::tile, TileInfo::tileh, TileOffsByDiagDir(), TO_BUILDINGS, and WaypGround.
Definition at line 3650 of file station_cmd.cpp.
Definition at line 3631 of file station_cmd.cpp.
Definition at line 3593 of file station_cmd.cpp.
Find the part of a dock that is land-based.
| t | Dock tile to find land part of |
Definition at line 3045 of file station_cmd.cpp.
References DIAGDIR_BEGIN, DIAGDIR_END, GetDockDirection(), GetStationGfx(), GFX_DOCK_BASE_WATER_PART, INVALID_TILE, IsDockTile(), IsValidTile(), and TileOffsByDiagDir().
Referenced by RemoveDock().
| CommandCost FindJoiningBaseStation | ( | StationID | existing_station, |
| StationID | station_to_join, | ||
| bool | adjacent, | ||
| TileArea | ta, | ||
| T ** | st, | ||
| F | filter ) |
Find a nearby station that joins this station.
| T | the class to find a station for |
| error_message | the error message when building a station on top of others |
| F | the filter functor type |
| existing_station | an existing station we build over |
| station_to_join | the station to join to |
| adjacent | whether adjacent stations are allowed |
| ta | the area of the newly build station |
| st | 'return' pointer for the found station |
| filter | The filter to remove unwanted stations. |
Definition at line 1276 of file station_cmd.cpp.
References _current_company, CommandCost::Failed(), GetStationAround(), and T.
Referenced by FindJoiningRoadStop(), FindJoiningStation(), and FindJoiningWaypoint().
|
static |
Find a nearby station that joins this road stop.
| existing_stop | an existing road stop we build over |
| station_to_join | the station to join to |
| adjacent | whether adjacent stations are allowed |
| ta | the area of the newly build station |
| st | 'return' pointer for the found station |
Definition at line 2027 of file station_cmd.cpp.
References FindJoiningBaseStation().
Referenced by CmdBuildRoadStop().
|
static |
Find a nearby station that joins this station.
| existing_station | an existing station we build over |
| station_to_join | the station to join to |
| adjacent | whether adjacent stations are allowed |
| ta | the area of the newly build station |
| st | 'return' pointer for the found station |
Definition at line 1320 of file station_cmd.cpp.
References FindJoiningBaseStation().
Referenced by CmdBuildAirport(), CmdBuildDock(), and CmdBuildRailStation().
| CommandCost FindJoiningWaypoint | ( | StationID | existing_waypoint, |
| StationID | waypoint_to_join, | ||
| bool | adjacent, | ||
| TileArea | ta, | ||
| Waypoint ** | wp, | ||
| bool | is_road ) |
Find a nearby waypoint that joins this waypoint.
| existing_waypoint | an existing waypoint we build over |
| waypoint_to_join | the waypoint to join to |
| adjacent | whether adjacent waypoints are allowed |
| ta | the area of the newly build waypoint |
| wp | 'return' pointer for the found waypoint |
| is_road | whether to find a road waypoint |
Definition at line 1335 of file station_cmd.cpp.
References FindJoiningBaseStation(), HasBit(), Waypoint::waypoint_flags, and WPF_ROAD.
Referenced by CmdBuildRailWaypoint(), and CmdBuildRoadWaypoint().
| truck_station | Determines whether a stop is RoadStopType::Bus or RoadStopType::Truck |
| st | The Station to do the whole procedure for |
Definition at line 2000 of file station_cmd.cpp.
References Station::bus_stops, RoadStop::next, and Station::truck_stops.
Referenced by CmdBuildRoadStop().
|
static |
Clear platform reservation during station building/removing.
| v | vehicle which holds reservation |
Definition at line 1348 of file station_cmd.cpp.
References FreeTrainTrackReservation(), Train::GetVehicleTrackdir(), IsRailStationTile(), SpecializedVehicle< T, Type >::Last(), ReverseTrackdir(), SetRailStationPlatformReservation(), Vehicle::tile, and TrackdirToExitdir().
Referenced by CmdBuildRailStation(), and RemoveFromRailBaseStation().
|
static |
Generate a station name for the given station at the given location.
This checks for local industries, the station type that is built and its surroundings to come up with an appropriate name.
| st | The station that is being built. |
| tile | The tile the station is being built at. |
| name_class | The type of station that is being built. |
StringID with the name of the station. Remaining station names that can be used when a more specific name has not been used.
Definition at line 263 of file station_cmd.cpp.
References _settings_game, Airport, CMSAMine(), CMSATree(), CMSAWater(), CountMapSquareAround(), DistanceFromEdge(), DistanceMax(), Dock, IndustrySpec::enabled, GetIndustrySpec(), GetIndustryType(), GetTileZ(), Heliport, Station::indtype, StationNameInformation::indtypes, Industry, StationNameInformation::IsAvailable(), IsInsideMM(), IsTileForestIndustry(), IsTileType(), SpecializedStation< Station, false >::Iterate(), NUM_INDUSTRYTYPES, Oilrig, StationNameInformation::SetUsed(), IndustrySpec::station_name, TileX(), TileY(), BaseStation::town, Tropic, and Town::xy.
Referenced by BuildStationPart().
|
static |
Get the acceptance of cargoes around the station in.
| st | Station to get acceptance of. |
Definition at line 611 of file station_cmd.cpp.
References AddAcceptedCargo(), Station::catchment_tiles, and INVALID_TILE.
Referenced by UpdateStationAcceptance().
| std::pair< CargoArray, CargoTypes > GetAcceptanceAroundTiles | ( | TileIndex | center_tile, |
| int | w, | ||
| int | h, | ||
| int | rad ) |
Get the acceptance of cargoes around the tile in 1/8.
| center_tile | Center of the search area |
| w | X extent of area |
| h | Y extent of area |
| rad | Search radius in addition to given area |
Definition at line 589 of file station_cmd.cpp.
References _settings_game, AddAcceptedCargo(), OrthogonalTileArea::Expand(), Industry::GetByTile(), Industry, and IsTileType().
Referenced by DrawStationCoverageAreaText().
| CargoTypes GetAcceptanceMask | ( | const Station * | st | ) |
Get a mask of the cargo types that the station accepts.
| st | Station to query |
Definition at line 507 of file station_cmd.cpp.
References GoodsEntry::Acceptance, Station::goods, and SetBit().
Referenced by StationViewWindow::DrawAcceptedCargo(), and UpdateStationAcceptance().
| uint8_t GetAirportNoiseLevelForDistance | ( | const AirportSpec * | as, |
| uint | distance ) |
Get a possible noise reduction factor based on distance from town center.
The further you get, the less noise you generate. So all those folks at city council can now happily slee... work in their offices
| as | airport information |
| distance | minimum distance between town and airport |
Definition at line 2545 of file station_cmd.cpp.
References _settings_game, and AirportSpec::noise_level.
Referenced by CmdBuildAirport(), RemoveAirport(), and UpdateAirportsNoise().
|
static |
Get station-type-specific string for a bridge that is too low.
| type | Station type. |
Definition at line 879 of file station_cmd.cpp.
References End, INVALID_STRING_ID, and to_underlying().
Referenced by IsStationBridgeAboveOk().
Find the closest deleted station of the current company.
| tile | the tile to search from. |
Definition at line 411 of file station_cmd.cpp.
References _current_company, DistanceManhattan(), ForAllStationsRadius(), BaseStation::IsInUse(), BaseStation::owner, and BaseStation::xy.
Referenced by BuildStationPart().
| CargoTypes GetEmptyMask | ( | const Station * | st | ) |
Get a mask of the cargo types that are empty at the station.
| st | Station to query |
Definition at line 522 of file station_cmd.cpp.
References Station::goods, and SetBit().
Referenced by TriggerRoadStopRandomisation(), and TriggerStationRandomisation().
| CargoArray GetProductionAroundTiles | ( | TileIndex | north_tile, |
| int | w, | ||
| int | h, | ||
| int | rad ) |
Get the cargo types being produced around the tile (in a rectangle).
| north_tile | Northern most tile of area |
| w | X extent of the area |
| h | Y extent of the area |
| rad | Search radius in addition to the given area |
Definition at line 552 of file station_cmd.cpp.
References _settings_game, AddProducedCargo(), OrthogonalTileArea::Expand(), GetIndustryIndex(), Industry, FlatSet< Tkey, Tcompare >::insert(), IsTileType(), IsValidCargoType(), Industry::neutral_station, and Industry::produced.
Referenced by DrawStationCoverageAreaText().
| CommandCost GetStationAround | ( | TileArea | ta, |
| StationID | closest_station, | ||
| CompanyID | company, | ||
| T ** | st, | ||
| F | filter ) |
Look for a station owned by the given company around the given tile area.
| ta | the area to search over |
| closest_station | the closest owned station found so far |
| company | the company whose stations to look for |
| st | to 'return' the found station |
| filter | Filter function |
Definition at line 124 of file station_cmd.cpp.
References OrthogonalTileArea::Expand(), GetStationIndex(), IsTileType(), Station, and T.
Referenced by FindJoiningBaseStation().
|
static |
Get blocked pillar information for a station tile.
| bridgeable_info | |
| layout | Tile layout of rail station. |
Definition at line 3216 of file station_cmd.cpp.
References RailStationTileLayout::layout.
Referenced by DrawTile_Station().
|
static |
Get bridgeable tile information for a station type.
| type | Station type. |
Definition at line 927 of file station_cmd.cpp.
References to_underlying().
Referenced by CheckBuildAbove_Station(), DrawTile_Station(), IsBuoyBridgeAboveOk(), IsDockBridgeAboveOk(), IsRailStationBridgeAboveOk(), and IsRoadStationBridgeAboveOk().
|
static |
Get station tile flags for the given StationGfx.
| gfx | StationGfx of station tile. |
| statspec | Station spec of station tile. |
Definition at line 1423 of file station_cmd.cpp.
References StationSpec::Pylons, and StationSpec::tileflags.
Referenced by SetRailStationTileFlags().
| const DrawTileSprites * GetStationTileLayout | ( | StationType | st, |
| uint8_t | gfx ) |
Get station tile layout for a station type and its station gfx.
| st | Station type to draw. |
| gfx | StationGfx of tile to draw. |
Definition at line 3138 of file station_cmd.cpp.
References to_underlying().
Referenced by DrawStationTile(), and DrawTile_Station().
Tile callback function signature for obtaining a tile description.
| tile | Tile being queried |
| td | Storage pointer for returned tile description |
Definition at line 3669 of file station_cmd.cpp.
References Airport, BaseStation::build_date, TileDesc::build_date, Buoy, Bus, Dock, BaseStation::GetByTile(), GetGRFConfig(), GetIndustrySpec(), GRFConfig::GetName(), GetStationType(), GetTileOwner(), TileDesc::grf, IndustrySpec::grf_prop, GRFFilePropsBase::grfid, GRFFilePropsBase::HasGrfFile(), HasStationRail(), IsAirport(), IsAnyRoadStop(), IsHangar(), IndustrySpec::name, Oilrig, Industry::owner, TileDesc::owner, Rail, RailWaypoint, RoadWaypoint, TileDesc::str, Truck, and Industry::type.
|
static |
Tile callback function signature for getting the possible tracks that can be taken on a given tile by a given transport.
The return value contains the existing trackdirs and signal states.
see track_func.h for usage of TrackStatus.
| tile | the tile to get the track status from |
| mode | the mode of transportation |
| sub_mode | used to differentiate between different kinds within the mode |
| side | The side where the tile is entered. |
Definition at line 3705 of file station_cmd.cpp.
References AxisToTrackBits(), CombineTrackStatus(), DiagDirToAxis(), DiagDirToDiagTrackBits(), GetBayRoadStopDir(), GetDriveThroughStopAxis(), GetRailStationTrack(), HasStationRail(), HasTileRoadType(), INVALID_DIAGDIR, IsAnyRoadStop(), IsBayRoadStopTile(), IsBuoy(), IsStationTileBlocked(), TileX(), TileY(), TRACK_BIT_ALL, TRACK_BIT_LEFT, TRACK_BIT_NONE, TRACK_BIT_RIGHT, TRACK_BIT_UPPER, TRACK_BIT_X, TRACK_BIT_Y, TrackBitsToTrackdirBits(), TRACKDIR_BIT_NONE, TrackToTrackBits(), TRANSPORT_RAIL, TRANSPORT_ROAD, and TRANSPORT_WATER.
| bool HasStationInUse | ( | StationID | station, |
| bool | include_company, | ||
| CompanyID | company ) |
Tests whether the company's vehicles have this station in orders.
| station | station ID |
| include_company | If true only check vehicles of company, if false only check vehicles of other companies |
| company | company ID |
true when at least one vehicle is ordered to go to this station. Definition at line 2882 of file station_cmd.cpp.
References Vehicle::owner.
Referenced by CompanyStationsWindow::BuildStationsList(), and RemoveBuoy().
| void IncreaseStats | ( | Station * | st, |
| CargoType | cargo, | ||
| StationID | next_station_id, | ||
| uint | capacity, | ||
| uint | usage, | ||
| uint32_t | time, | ||
| EdgeUpdateModes | modes ) |
Increase capacity for a link stat given by station cargo and next hop.
| st | Station to get the link stats from. |
| cargo | Cargo to increase stat for. |
| next_station_id | Station the consist will be travelling to next. |
| capacity | Capacity to add to link stat. |
| usage | Usage to add to link stat. |
| time | The travel time for the link. |
| modes | Update modes to be applied. |
Definition at line 4284 of file station_cmd.cpp.
References LinkGraph::AddNode(), Debug, SpecializedStation< Station, false >::Get(), Station::goods, LinkGraphSchedule::instance, GoodsEntry::link_graph, LinkGraph::Merge(), GoodsEntry::node, and LinkGraph::Size().
Referenced by Vehicle::BeginLoading(), IncreaseStats(), and LinkRefresher::RefreshStats().
| void IncreaseStats | ( | Station * | st, |
| const Vehicle * | front, | ||
| StationID | next_station_id, | ||
| uint32_t | time ) |
Increase capacity for all link stats associated with vehicles in the given consist.
| st | Station to get the link stats from. |
| front | First vehicle in the consist. |
| next_station_id | Station the consist will be travelling to next. |
| time | The travel time for the links. |
Definition at line 4337 of file station_cmd.cpp.
References Increase, IncreaseStats(), and Vehicle::Next().
| CommandCost IsBuoyBridgeAboveOk | ( | TileIndex | tile | ) |
Test if a buoy can be built below a bridge.
| tile | Tile to test. |
Definition at line 986 of file station_cmd.cpp.
References Buoy, GetBridgeHeight(), GetSouthernBridgeEnd(), GetStationBridgeableTileInfo(), IsBridgeAbove(), and IsStationBridgeAboveOk().
Referenced by CmdBuildBuoy().
|
static |
Test if a dock can be built below a bridge.
| tile | Tile to test. |
| layout | Layout piece of station to test. |
Definition at line 972 of file station_cmd.cpp.
References Dock, GetBridgeHeight(), GetSouthernBridgeEnd(), GetStationBridgeableTileInfo(), IsBridgeAbove(), and IsStationBridgeAboveOk().
Referenced by CmdBuildDock().
| bool IsHangar | ( | Tile | t | ) |
Check whether the given tile is a hangar.
| t | the tile to of whether it is a hangar. |
Definition at line 97 of file station_cmd.cpp.
References Station::airport, AirportSpec::depots, BaseStation::GetByTile(), Airport::GetRotatedTileFromOffset(), Airport::GetSpec(), IsAirport(), IsTileType(), and Station.
Referenced by ClickTile_Station(), GetTileDesc_Station(), and IsHangarTile().
| CommandCost IsRailStationBridgeAboveOk | ( | TileIndex | tile, |
| const StationSpec * | spec, | ||
| StationType | type, | ||
| StationGfx | layout ) |
Test if a rail station can be built below a bridge.
| tile | Tile to test. |
| spec | Custom station spec to test. |
| type | Type of rail station. |
| layout | Layout piece of station to test. |
Definition at line 940 of file station_cmd.cpp.
References StationSpec::bridgeable_info, GetBridgeHeight(), GetSouthernBridgeEnd(), GetStationBridgeableTileInfo(), IsBridgeAbove(), and IsStationBridgeAboveOk().
Referenced by CmdBuildRailStation(), and CmdBuildRailWaypoint().
| CommandCost IsRoadStationBridgeAboveOk | ( | TileIndex | tile, |
| const RoadStopSpec * | spec, | ||
| StationType | type, | ||
| StationGfx | layout ) |
Test if a road station can be built below a bridge.
| tile | Tile to test. |
| spec | Custom roadstop spec to test. |
| type | Type of road station. |
| layout | Layout piece of station to test. |
Definition at line 957 of file station_cmd.cpp.
References RoadStopSpec::bridgeable_info, GetBridgeHeight(), GetSouthernBridgeEnd(), GetStationBridgeableTileInfo(), IsBridgeAbove(), and IsStationBridgeAboveOk().
Referenced by CheckFlatLandRoadStop().
|
static |
Test if a bridge can be built above a station.
| tile | Tile to test. |
| bridgeable_info | Minimum height before bridge is okay for each of the layouts. |
| type | Type of station. |
| layout | Layout piece of road station to test. |
| bridge_height | Height of bridge to test. |
| disallowed_msg | Error message if bridge is disallowed. |
Definition at line 905 of file station_cmd.cpp.
References Auto, CommandCostWithParam(), GetBridgeTooLowMessageForStationType(), GetTileMaxZ(), INVALID_STRING_ID, and TILE_HEIGHT_STEP.
Referenced by CheckBuildAbove_Station(), IsBuoyBridgeAboveOk(), IsDockBridgeAboveOk(), IsRailStationBridgeAboveOk(), and IsRoadStationBridgeAboveOk().
|
static |
Definition at line 4472 of file station_cmd.cpp.
|
static |
Definition at line 1730 of file station_cmd.cpp.
| void MakeRoadWaypointStationAreaSmaller | ( | BaseStation * | st, |
| TileArea & | road_waypoint_area ) |
Definition at line 1751 of file station_cmd.cpp.
|
static |
Definition at line 1740 of file station_cmd.cpp.
|
static |
Definition at line 1675 of file station_cmd.cpp.
| void ModifyStationRatingAround | ( | TileIndex | tile, |
| Owner | owner, | ||
| int | amount, | ||
| uint | radius ) |
Forcibly modify station ratings near a given tile.
Used when a crash hurts a company's station ratings nearby, or when local authority actions affect nearby ratings.
| tile | The center of the ratings change area. |
| owner | The station owner whose stations are affected. |
| amount | The amount to change the rating. |
| radius | The radius to search for stations, from the origin tile. |
Definition at line 4411 of file station_cmd.cpp.
References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Any(), ClampTo(), DistanceManhattan(), ForAllStationsRadius(), Station::goods, BaseStation::owner, GoodsEntry::rating, GoodsEntry::status, and BaseStation::xy.
Referenced by CheckTrainCollision(), CrashAirplane(), TownActionAdvertiseLarge(), TownActionAdvertiseMedium(), TownActionAdvertiseSmall(), and TownActionBuyRights().
| uint MoveGoodsToStation | ( | CargoType | cargo, |
| uint | amount, | ||
| Source | source, | ||
| const StationList & | all_stations, | ||
| Owner | exclusivity ) |
Definition at line 4622 of file station_cmd.cpp.
| void OnTick_Station | ( | ) |
Definition at line 4365 of file station_cmd.cpp.
|
static |
Remove an airport.
| tile | TileIndex been queried |
| flags | operation to perform |
Definition at line 2777 of file station_cmd.cpp.
References _current_company, _price, _settings_game, CommandCost::AddCost(), Station::AfterStationTileSetChange(), Airport, Station::airport, AirportGetNearestTown(), CheckOwnership(), OrthogonalTileArea::Clear(), ClearStationAirport, CloseWindowById(), DeleteNewGRFInspectWindow(), EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), FLYING, GetAirportNoiseLevelForDistance(), BaseStation::GetByTile(), Airport::GetHangarTile(), Airport::GetNumHangars(), Airport::GetSpec(), InvalidateWindowData(), Town::noise_reached, BaseStation::owner, OWNER_WATER, Airport::psa, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), OrderBackup::Reset(), SetWindowClassesDirty(), SetWindowDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, WC_STATION_VIEW, WC_TOWN_VIEW, WC_VEHICLE_DEPOT, and WC_VEHICLE_ORDERS.
Referenced by ClearTile_Station().
|
static |
Remove a dock.
| tile | TileIndex been queried |
| flags | operation to perform |
Definition at line 3068 of file station_cmd.cpp.
References _price, Station::AfterStationTileSetChange(), CheckOwnership(), OrthogonalTileArea::Clear(), ClearDockingTilesCheckingNeighbours(), ClearStationDock, CMD_ERROR, Dock, Station::docking_station, EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), FindDockLandPart(), BaseStation::GetByTile(), GetDockDirection(), INVALID_TILE, IsDockingTile(), IsDockTile(), IsShipDestinationTile(), MarkTileDirtyByTile(), BaseStation::owner, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), SetWindowClassesDirty(), Station::ship_station, CommandCost::Succeeded(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, TileOffsByDiagDir(), and WC_VEHICLE_ORDERS.
Referenced by ClearTile_Station().
| void RemoveDockingTile | ( | TileIndex | t | ) |
Definition at line 3003 of file station_cmd.cpp.
| CommandCost RemoveFromRailBaseStation | ( | TileArea | ta, |
| std::vector< T * > & | affected_stations, | ||
| DoCommandFlags | flags, | ||
| Money | removal_cost, | ||
| bool | keep_rail ) |
Remove a number of tiles from any rail station within the area.
| ta | the area to clear station tile from. |
| affected_stations | the stations affected. |
| flags | the command flags. |
| removal_cost | the cost for removing the tile, including the rail. |
| keep_rail | whether to keep the rail of the station. |
| T | the type of station to remove. |
Definition at line 1767 of file station_cmd.cpp.
References _current_company, _price, CommandCost::AddCost(), AddTrackToSignalBuffer(), CheckOwnership(), ClearRail, DeallocateSpecFromStation(), DeleteNewGRFInspectWindow(), DeleteStationIfEmpty(), DirtyCompanyInfrastructureWindows(), EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), FreeTrainReservation(), GetCustomStationSpecIndex(), GetRailStationTrack(), GetRailType(), GetTileOwner(), GetTrainForReservation(), HasStationReservation(), HasStationTileRail(), include(), INVALID_TILE, IsStationTileBlocked(), MakeRailNormal(), OWNER_WATER, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), RestoreTrainReservation(), SetWindowClassesDirty(), SetWindowWidgetDirty(), T, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, TrackToTrackBits(), Train, BaseStation::train_station, BaseStation::UpdateVirtCoord(), WC_STATION_VIEW, WC_VEHICLE_ORDERS, WID_SV_TRAINS, and YapfNotifyTrackLayoutChange().
Referenced by CmdRemoveFromRailStation(), CmdRemoveFromRailWaypoint(), and RemoveRailStation().
|
static |
Remove a tile area of road stop or road waypoints.
| flags | operation to perform |
| roadstop_area | tile area of road stop or road waypoint tiles to remove |
| road_waypoint | Whether to remove road waypoints or road stops |
| remove_road | Remove roads of drive-through stops? |
Definition at line 2442 of file station_cmd.cpp.
References _current_company, CommandCost::AddCost(), AxisToRoadBits(), ClosestTownFromTile(), CountBits(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), GetDriveThroughStopAxis(), GetRoadOwner(), GetRoadType(), INVALID_ROADTYPE, IsAnyRoadStop(), IsDriveThroughStopTile(), IsRoadWaypoint(), IsTileType(), MakeRoadNormal(), OWNER_NONE, RemoveRoadStop(), RemoveRoadWaypointStop(), ROAD_NONE, RTT_ROAD, RTT_TRAM, Station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and UpdateCompanyRoadInfrastructure().
Referenced by CmdRemoveFromRoadWaypoint(), and CmdRemoveRoadStop().
| CommandCost RemoveRailStation | ( | T * | st, |
| DoCommandFlags | flags, | ||
| Money | removal_cost ) |
Remove a rail station/waypoint.
| st | The station/waypoint to remove the rail part from |
| flags | operation to perform |
| removal_cost | the cost for removing a tile |
| T | the type of station to remove |
Definition at line 1929 of file station_cmd.cpp.
References _current_company, CommandCost::AddCost(), CheckOwnership(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), OrthogonalTileArea::h, OWNER_WATER, RemoveFromRailBaseStation(), T, and OrthogonalTileArea::w.
Referenced by ClearTile_Station(), RemoveRailStation(), and RemoveRailWaypoint().
|
static |
Remove a rail station.
| tile | Tile of the station. |
| flags | operation to perform |
Definition at line 1963 of file station_cmd.cpp.
References _current_company, _price, ClearStationRail, Execute, BaseStation::GetByTile(), OWNER_WATER, Station::RecomputeCatchment(), RemoveRailStation(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
|
static |
Remove a rail waypoint.
| tile | Tile of the waypoint. |
| flags | operation to perform |
Definition at line 1984 of file station_cmd.cpp.
References _current_company, _price, ClearWaypointRail, Execute, BaseStation::GetByTile(), OWNER_WATER, and RemoveRailStation().
Referenced by ClearTile_Station().
|
static |
Remove a bus station/truck stop.
| tile | TileIndex been queried |
| flags | operation to perform |
| replacement_spec_index | replacement spec index to avoid deallocating, if < 0, tile is not being replaced |
Definition at line 2250 of file station_cmd.cpp.
References _current_company, _price, OrthogonalTileArea::Add(), Station::AfterStationTileSetChange(), Bankrupt, Bus, Station::bus_station, Station::bus_stops, BusStop, CheckOwnership(), OrthogonalTileArea::Clear(), RoadStop::ClearDriveThrough(), ClearStationBus, ClearStationTruck, Vehicle::current_order, DeallocateSpecFromRoadStop(), DeleteAnimatedTile(), DeleteNewGRFInspectWindow(), Vehicle::dest_tile, DirtyCompanyInfrastructureWindows(), EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), FindVehiclesWithOrder(), SpecializedVehicle< RoadVehicle, Type >::From(), BaseStation::GetByTile(), RoadStop::GetByTile(), RoadStopSpec::GetClearCost(), GetCustomRoadStopSpecIndex(), Vehicle::GetOrderStationLocation(), GetRoadOwner(), GetRoadType(), HasBit(), IsDriveThroughStopTile(), IsTruckStop(), Order::IsType(), RoadStop::next, BaseStation::owner, OWNER_WATER, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), ROAD_STOP_TRACKBIT_FACTOR, RVS_IN_DT_ROAD_STOP, RVSB_ROAD_STOP_TRACKDIR_MASK, Vehicle::SetDestTile(), SetWindowClassesDirty(), RoadVehicle::state, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Truck, Station::truck_station, Station::truck_stops, TruckStop, BaseVehicle::type, UpdateCompanyRoadInfrastructure(), VEH_ROAD, and WC_VEHICLE_ORDERS.
Referenced by ClearTile_Station(), CmdBuildRoadStop(), and RemoveGenericRoadStop().
| CommandCost RemoveRoadWaypointStop | ( | TileIndex | tile, |
| DoCommandFlags | flags, | ||
| int | replacement_spec_index ) |
Remove a road waypoint.
| tile | TileIndex been queried |
| flags | operation to perform |
| replacement_spec_index | replacement spec index to avoid deallocating, if < 0, tile is not being replaced |
Definition at line 2377 of file station_cmd.cpp.
References _current_company, _price, Bankrupt, BusStop, CheckOwnership(), ClearStationTruck, DeallocateSpecFromRoadStop(), DeleteNewGRFInspectWindow(), DeleteStationIfEmpty(), DirtyCompanyInfrastructureWindows(), EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), BaseStation::GetByTile(), RoadStopSpec::GetClearCost(), GetCustomRoadStopSpecIndex(), GetRoadOwner(), GetRoadType(), INVALID_TILE, BaseStation::owner, OWNER_WATER, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), ROAD_STOP_TRACKBIT_FACTOR, Waypoint::road_waypoint_area, SetWindowWidgetDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, TruckStop, UpdateCompanyRoadInfrastructure(), Waypoint::UpdateVirtCoord(), WC_STATION_VIEW, and WID_SV_ROADVEHS.
Referenced by ClearTile_Station(), CmdBuildRoadWaypoint(), and RemoveGenericRoadStop().
Reroute cargo of type c at station st or in any vehicles unloading there.
Make sure the cargo's new next hop is neither "avoid" nor "avoid2".
| st | Station to be rerouted at. |
| cargo | Type of cargo. |
| avoid | Original next hop of cargo, avoid this. |
| avoid2 | Another station to be avoided when rerouting. |
Definition at line 4165 of file station_cmd.cpp.
References GoodsEntry::GoodsEntryData::cargo, GoodsEntry::GetData(), Station::goods, GoodsEntry::HasData(), Vehicle::Next(), and StationCargoList::Reroute().
Referenced by DeleteStaleLinks(), LinkGraphJob::~LinkGraphJob(), and Station::~Station().
|
static |
Restore platform reservation during station building/removing.
| v | vehicle which held reservation |
Definition at line 1360 of file station_cmd.cpp.
References Train::GetVehicleTrackdir(), IsRailStationTile(), SpecializedVehicle< T, Type >::Last(), ReverseTrackdir(), SetRailStationPlatformReservation(), Vehicle::tile, TrackdirToExitdir(), and TryPathReserve().
Referenced by CmdBuildRailStation(), and RemoveFromRailBaseStation().
| void SetRailStationTileFlags | ( | TileIndex | tile, |
| const StationSpec * | statspec ) |
Set rail station tile flags for the given tile.
| tile | Tile to set flags on. |
| statspec | Statspec of the tile. |
Definition at line 1435 of file station_cmd.cpp.
References StationSpec::Blocked, GetStationGfx(), GetStationTileFlags(), StationSpec::NoWires, StationSpec::Pylons, SetStationTileBlocked(), SetStationTileHavePylons(), and SetStationTileHaveWires().
Referenced by CmdBuildRailStation(), and CmdBuildRailWaypoint().
|
static |
Add news item for when a station changes which cargoes it accepts.
| st | Station of cargo change. |
| cargoes | Bit mask of cargo types to list. |
| reject | True iff the station rejects the cargo types. |
Definition at line 538 of file station_cmd.cpp.
References Acceptance, AddNewsItem(), GetEncodedString(), InColour, and Small.
Referenced by UpdateStationAcceptance().
| bool SplitGroundSpriteForOverlay | ( | const TileInfo * | ti, |
| SpriteID * | ground, | ||
| RailTrackOffset * | overlay_offset ) |
Check whether a sprite is a track sprite, which can be replaced by a non-track ground sprite and a rail overlay.
If the ground sprite is suitable, ground is replaced with the new non-track ground sprite, and overlay_offset is set to the overlay to draw.
| ti | Positional info for the tile to decide snowyness etc. May be nullptr. | |
| [in,out] | ground | Groundsprite to draw. |
| [out] | overlay_offset | Overlay to draw. |
Definition at line 3154 of file station_cmd.cpp.
References _settings_game, Arctic, GetSnowLine(), GetTropicZone(), RTO_X, RTO_Y, TileInfo::tile, TILE_HEIGHT, Tropic, TROPICZONE_DESERT, and Coord3D< T >::z.
Referenced by DrawStationTile(), and DrawTile_Station().
|
static |
This function is called for each station once every 250 ticks.
Not all stations will get the tick at the same time.
| st | the station receiving the tick. |
Definition at line 3939 of file station_cmd.cpp.
References GoodsEntry::AcceptedBigtick, BaseStation::delete_ctr, BaseStation::facilities, SpecializedStation< Station, false >::From(), SpecializedStation< Station, false >::IsExpected(), BaseStation::IsInUse(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), GoodsEntry::status, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TriggerWatchedCargoCallbacks(), UpdateStationAcceptance(), and Waypoint.
|
static |
Definition at line 4354 of file station_cmd.cpp.
| void StationPickerDrawSprite | ( | int | x, |
| int | y, | ||
| StationType | st, | ||
| RailType | railtype, | ||
| RoadType | roadtype, | ||
| int | image ) |
Definition at line 3541 of file station_cmd.cpp.
|
static |
Tile callback function signature of the terraforming callback.
The function is called when a tile is affected by a terraforming operation. It has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype. With DoCommandFlag::Execute in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself).
| tile | The involved tile. |
| flags | Command flags passed to the terraform command (DoCommandFlag::Execute, DoCommandFlag::QueryCost, etc.). |
| z_new | TileZ after terraforming. |
| tileh_new | Slope after terraforming. |
Definition at line 4965 of file station_cmd.cpp.
References _price, _settings_game, Airport, AutoslopeCheckForAxis(), AutoslopeCheckForEntranceEdge(), AutoslopeEnabled(), BuildFoundation, Bus, EXPENSES_CONSTRUCTION, GetBayRoadStopDir(), GetDriveThroughStopAxis(), GetRailStationAxis(), GetSlopeMaxZ(), GetStationType(), GetTileMaxZ(), IsDriveThroughStopTile(), Rail, RailWaypoint, RoadWaypoint, and Truck.
|
static |
Definition at line 1725 of file station_cmd.cpp.
|
static |
Definition at line 1746 of file station_cmd.cpp.
|
static |
Definition at line 1735 of file station_cmd.cpp.
|
static |
Tile callback function signature for running periodic tile updates.
| tile | The tile to update. |
Definition at line 3753 of file station_cmd.cpp.
References _settings_game, Airport, Arctic, Barren, Buoy, Bus, ClosestTownFromTile(), Dock, SpecializedStation< Station, false >::From(), BaseStation::GetByTile(), GetRoadWaypointRoadside(), GetSnowLine(), GetStationType(), GetTileZ(), GetTownRadiusGroup(), GetTropicZone(), Grass, IsRoadWaypointOnSnowOrDesert(), IsTileFlat(), MarkTileDirtyByTile(), Oilrig, Paved, Rail, RailWaypoint, RoadWaypoint, SetRoadWaypointRoadside(), TileLoop, TileLoop_Water(), ToggleRoadWaypointOnSnowOrDesert(), TownEdge, Tropic, TROPICZONE_DESERT, and Truck.
| void TriggerWatchedCargoCallbacks | ( | Station * | st | ) |
Run the watched cargo callback for all houses in the catchment area.
| st | Station. |
Definition at line 3913 of file station_cmd.cpp.
References GoodsEntry::AcceptedBigtick, Station::catchment_tiles, Station::goods, House, INVALID_TILE, IsTileType(), NUM_CARGO, SetBit(), and TriggerHouseAnimation_WatchedCargoAccepted().
Referenced by StationHandleBigTick().
|
static |
Truncate the cargo by a specific amount.
| cs | The type of cargo to perform the truncation for. |
| ge | The goods entry, of the station, to truncate. |
| amount | The amount to truncate the cargo by. |
Definition at line 3972 of file station_cmd.cpp.
References GoodsEntry::GoodsEntryData::cargo, GoodsEntry::GetData(), SpecializedStation< Station, false >::GetIfValid(), Station::goods, GoodsEntry::HasData(), CargoSpec::Index(), GoodsEntry::max_waiting_cargo, and StationCargoList::Truncate().
Referenced by UpdateStationRating().
| void UpdateAirportsNoise | ( | ) |
Recalculate the noise generated by the airports of each town.
Definition at line 2626 of file station_cmd.cpp.
References AirportGetNearestTown(), AT_OILRIG, GetAirportNoiseLevelForDistance(), INVALID_TILE, SpecializedStation< Station, false >::Iterate(), and Town::noise_reached.
Referenced by DoCreateTown(), and InitializeWindowsAndCaches().
| void UpdateAllStationVirtCoords | ( | ) |
Update the virtual coords needed to draw the station sign for all stations.
Definition at line 482 of file station_cmd.cpp.
Referenced by CmdRenameTown(), and UpdateAllVirtCoords().
| void UpdateStationAcceptance | ( | Station * | st, |
| bool | show_msg ) |
Update the acceptance for a station.
| st | Station to update |
| show_msg | controls whether to display a message that acceptance was changed. |
Definition at line 629 of file station_cmd.cpp.
References _local_company, GoodsEntry::Acceptance, Station::always_accepted, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Any(), BaseStation::facilities, GetAcceptanceAroundStation(), GetAcceptanceMask(), Station::goods, IsCargoInClass(), BaseStation::IsInUse(), GoodsEntry::link_graph, GoodsEntry::node, NUM_CARGO, BaseStation::owner, Passengers, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), SetWindowWidgetDirty(), ShowRejectOrAcceptNews(), GoodsEntry::status, WC_STATION_VIEW, and WID_SV_ACCEPT_RATING_LIST.
Referenced by AfterLoadGame(), Station::AfterStationTileSetChange(), and StationHandleBigTick().
| void UpdateStationDockingTiles | ( | Station * | st | ) |
Definition at line 4707 of file station_cmd.cpp.
|
static |
Periodic update of a station's rating.
| st | The station to update. |
Definition at line 3994 of file station_cmd.cpp.
References _cheats, _settings_game, GoodsEntry::AvailableCount(), CALLBACK_FAILED, CBID_CARGO_STATION_RATING_CALC, Clamp(), ClampTo(), GB(), GoodsEntry::GetData(), Station::goods, HasBit(), GoodsEntry::HasData(), GoodsEntry::HasRating(), GoodsEntry::HasVehicleEverTriedLoading(), CargoSpec::Iterate(), GoodsEntry::last_age, GoodsEntry::last_speed, GoodsEntry::max_waiting_cargo, BaseStation::owner, GoodsEntry::Rating, GoodsEntry::rating, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), SetWindowDirty(), SetWindowWidgetDirty(), StationRatingCalc, Town::statues, GoodsEntry::status, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), GoodsEntry::time_since_pickup, BaseStation::town, TruncateCargo(), VEH_INVALID, VEH_SHIP, WC_STATION_VIEW, and WID_SV_ACCEPT_RATING_LIST.
|
static |
Definition at line 677 of file station_cmd.cpp.
Definition at line 4424 of file station_cmd.cpp.
|
static |
Tile callback function for a vehicle entering a tile.
| v | Vehicle entering the tile. |
| tile | Tile entered. |
| x | X position in world coordinates. |
| y | Y position in world coordinates. |
Definition at line 3860 of file station_cmd.cpp.
References AXIS_X, CannotEnter, Vehicle::cur_speed, Vehicle::current_order, DIAGDIR_SE, DIAGDIR_SW, DiagDirToAxis(), Vehicle::direction, DirToDiagDir(), Enter, EnteredStation, SpecializedVehicle< RoadVehicle, Type >::From(), SpecializedVehicle< Train, Type >::From(), RoadStop::GetByTile(), GetRoadStopType(), GetStationIndex(), GetTrainStopLocation(), Vehicle::IsFrontEngine(), IsRailStation(), IsReversingRoadTrackdir(), IsStationRoadStop(), RVSB_IN_ROAD_STOP, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), Order::ShouldStopAtStation(), RoadVehicle::state, TILE_SIZE, TrainSlowing, BaseVehicle::type, VEH_ROAD, VEH_TRAIN, and Vehicle::vehstatus.
|
static |
Definition at line 2905 of file station_cmd.cpp.
|
static |
Definition at line 2898 of file station_cmd.cpp.
|
static |
Definition at line 2904 of file station_cmd.cpp.
|
extern |
TileTypeProcs definitions for TileType::Station tiles.
Definition at line 57 of file landscape.cpp.