OpenTTD Source: src/station_cmd.h Source File

OpenTTD Source 14.0-beta3

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
16 enum StationClassID : byte;
17 enum RoadStopClassID : byte;
18
19 extern Town *AirportGetNearestTown(const struct AirportSpec *as, Direction rotation, TileIndex tile, TileIterator &&it, uint &mindist);
20 extern uint8_t GetAirportNoiseLevelForDistance(const struct AirportSpec *as, uint distance);
21
22 CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, byte airport_type, byte layout, StationID station_to_join, bool allow_adjacent);
23 CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_to_join, bool adjacent);
24 CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent);
25 CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail);
26 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);
27 CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8_t width, uint8_t height, RoadStopType stop_type, bool remove_road);
28 CommandCost CmdRenameStation(DoCommandFlag flags, StationID station_id, const std::string &text);
29 CommandCost CmdOpenCloseAirport(DoCommandFlag flags, StationID station_id);
30
31 DEF_CMD_TRAIT(CMD_BUILD_AIRPORT, CmdBuildAirport, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION)
32 DEF_CMD_TRAIT(CMD_BUILD_DOCK, CmdBuildDock, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION)
33 DEF_CMD_TRAIT(CMD_BUILD_RAIL_STATION, CmdBuildRailStation, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION)
34 DEF_CMD_TRAIT(CMD_REMOVE_FROM_RAIL_STATION, CmdRemoveFromRailStation, 0, CMDT_LANDSCAPE_CONSTRUCTION)
35 DEF_CMD_TRAIT(CMD_BUILD_ROAD_STOP, CmdBuildRoadStop, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION)
36 DEF_CMD_TRAIT(CMD_REMOVE_ROAD_STOP, CmdRemoveRoadStop, 0, CMDT_LANDSCAPE_CONSTRUCTION)
37 DEF_CMD_TRAIT(CMD_RENAME_STATION, CmdRenameStation, 0, CMDT_OTHER_MANAGEMENT)
38 DEF_CMD_TRAIT(CMD_OPEN_CLOSE_AIRPORT, CmdOpenCloseAirport, 0, CMDT_ROUTE_MANAGEMENT)
39
40 #endif /* STATION_CMD_H */
Direction
Direction
Defines the 8 directions on the map.
Definition: direction_type.h:24
CmdBuildRailStation
CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent)
Build rail station.
Definition: station_cmd.cpp:1313
RoadStopType
RoadStopType
Types of RoadStops.
Definition: station_type.h:43
CMD_REMOVE_ROAD_STOP
@ CMD_REMOVE_ROAD_STOP
remove a road stop
Definition: command_type.h:211
CmdOpenCloseAirport
CommandCost CmdOpenCloseAirport(DoCommandFlag flags, StationID station_id)
Open/close an airport to incoming aircraft.
Definition: station_cmd.cpp:2596
Axis
Axis
Allow incrementing of DiagDirDiff variables.
Definition: direction_type.h:116
CMD_BUILD_DOCK
@ CMD_BUILD_DOCK
build a dock
Definition: command_type.h:220
CmdBuildAirport
CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, byte airport_type, byte layout, StationID station_to_join, bool allow_adjacent)
Place an Airport.
Definition: station_cmd.cpp:2386
GetAirportNoiseLevelForDistance
uint8_t GetAirportNoiseLevelForDistance(const AirportSpec *as, uint distance)
Get a possible noise reduction factor based on distance from town center.
Definition: station_cmd.cpp:2282
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
AirportSpec
Defines the data structure for an airport.
Definition: newgrf_airport.h:100
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:369
CMD_RENAME_STATION
@ CMD_RENAME_STATION
rename a station
Definition: command_type.h:265
RailType
RailType
Enumeration for all possible railtypes.
Definition: rail_type.h:27
CommandCost
Common return value for all commands.
Definition: command_type.h:23
CMDT_OTHER_MANAGEMENT
@ CMDT_OTHER_MANAGEMENT
Renaming stuff, changing company colours, placing signs, etc.
Definition: command_type.h:414
CMD_AUTO
@ CMD_AUTO
set the DC_AUTO flag on this command
Definition: command_type.h:395
TileIterator
Base class for tile iterators.
Definition: tilearea_type.h:105
CMDT_ROUTE_MANAGEMENT
@ CMDT_ROUTE_MANAGEMENT
Modifications to route management (orders, groups, etc).
Definition: command_type.h:413
CMD_BUILD_AIRPORT
@ CMD_BUILD_AIRPORT
build an airport
Definition: command_type.h:218
DiagDirection
DiagDirection
Enumeration for diagonal directions.
Definition: direction_type.h:73
CmdRemoveFromRailStation
CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail)
Remove a single tile from a rail station.
Definition: station_cmd.cpp:1718
command_type.h
CMD_NO_WATER
@ CMD_NO_WATER
set the DC_NO_WATER flag on this command
Definition: command_type.h:398
CMD_BUILD_RAIL_STATION
@ CMD_BUILD_RAIL_STATION
build a rail station
Definition: command_type.h:194
CmdRenameStation
CommandCost CmdRenameStation(DoCommandFlag flags, StationID station_id, const std::string &text)
Rename a station.
Definition: station_cmd.cpp:4106
AirportGetNearestTown
Town * AirportGetNearestTown(const AirportSpec *as, Direction rotation, TileIndex tile, TileIterator &&it, uint &mindist)
Finds the town nearest to given airport.
Definition: station_cmd.cpp:2313
StationClassID
StationClassID
Definition: newgrf_station.h:83
RoadType
RoadType
The different roadtypes we support.
Definition: road_type.h:25
Town
Town data structure.
Definition: town.h:50
CmdBuildRoadStop
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.
Definition: station_cmd.cpp:1930
CMD_BUILD_ROAD_STOP
@ CMD_BUILD_ROAD_STOP
build a road stop
Definition: command_type.h:210
RoadStopClassID
RoadStopClassID
Definition: newgrf_roadstop.h:25
CMD_REMOVE_FROM_RAIL_STATION
@ CMD_REMOVE_FROM_RAIL_STATION
remove a (rectangle of) tiles from a rail station
Definition: command_type.h:203
CmdBuildDock
CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_to_join, bool adjacent)
Build a dock/haven.
Definition: station_cmd.cpp:2650
CMDT_LANDSCAPE_CONSTRUCTION
@ CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
Definition: command_type.h:409
station_type.h
CMD_OPEN_CLOSE_AIRPORT
@ CMD_OPEN_CLOSE_AIRPORT
open/close an airport to incoming aircraft
Definition: command_type.h:353
CmdRemoveRoadStop
CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8_t width, uint8_t height, RoadStopType stop_type, bool remove_road)
Remove bus or truck stops.
Definition: station_cmd.cpp:2216