OpenTTD Source 20241224-master-gf74b0cf984
station_cmd.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef STATION_CMD_H
11#define STATION_CMD_H
12
13#include "command_type.h"
14#include "station_type.h"
15
16enum StationClassID : uint16_t;
17enum RoadStopClassID : uint16_t;
18
19extern Town *AirportGetNearestTown(const struct AirportSpec *as, Direction rotation, TileIndex tile, TileIterator &&it, uint &mindist);
20extern uint8_t GetAirportNoiseLevelForDistance(const struct AirportSpec *as, uint distance);
21
22CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint8_t airport_type, uint8_t layout, StationID station_to_join, bool allow_adjacent);
23CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_to_join, bool adjacent);
24CommandCost CmdBuildRailStation(DoCommandFlag 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);
26CommandCost CmdBuildRoadStop(DoCommandFlag 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);
27CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8_t width, uint8_t height, RoadStopType stop_type, bool remove_road);
28CommandCost CmdRenameStation(DoCommandFlag flags, StationID station_id, const std::string &text);
29CommandCost CmdOpenCloseAirport(DoCommandFlag flags, StationID station_id);
30
39
40#endif /* STATION_CMD_H */
Common return value for all commands.
Base class for tile iterators.
Types related to commands.
@ CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
@ CMDT_ROUTE_MANAGEMENT
Modifications to route management (orders, groups, etc).
@ CMDT_OTHER_MANAGEMENT
Renaming stuff, changing company colours, placing signs, etc.
DoCommandFlag
List of flags for a command.
@ CMD_OPEN_CLOSE_AIRPORT
open/close an airport to incoming aircraft
@ CMD_BUILD_DOCK
build a dock
@ CMD_BUILD_AIRPORT
build an airport
@ CMD_BUILD_ROAD_STOP
build a road stop
@ CMD_BUILD_RAIL_STATION
build a rail station
@ CMD_RENAME_STATION
rename a station
@ CMD_REMOVE_FROM_RAIL_STATION
remove a (rectangle of) tiles from a rail station
@ CMD_REMOVE_ROAD_STOP
remove a road stop
@ CMD_AUTO
set the DC_AUTO flag on this command
@ CMD_NO_WATER
set the DC_NO_WATER flag on this command
Direction
Defines the 8 directions on the map.
Axis
Allow incrementing of DiagDirDiff variables.
DiagDirection
Enumeration for diagonal directions.
RoadStopClassID
StationClassID
RailType
Enumeration for all possible railtypes.
Definition rail_type.h:27
RoadType
The different roadtypes we support.
Definition road_type.h:25
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.
CommandCost CmdOpenCloseAirport(DoCommandFlag flags, StationID station_id)
Open/close an airport to incoming aircraft.
CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8_t width, uint8_t height, RoadStopType stop_type, bool remove_road)
Remove bus or truck stops.
CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail)
Remove a single tile from a rail station.
CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_to_join, bool adjacent)
Build a dock/haven.
CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint8_t airport_type, uint8_t layout, StationID station_to_join, bool allow_adjacent)
Place an Airport.
CommandCost CmdBuildRoadStop(DoCommandFlag 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.
CommandCost CmdBuildRailStation(DoCommandFlag 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.
CommandCost CmdRenameStation(DoCommandFlag flags, StationID station_id, const std::string &text)
Rename a station.
Types related to stations.
RoadStopType
Types of RoadStops.
Defines the data structure for an airport.
Town data structure.
Definition town.h:54