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/>.
8 /** @file road_cmd.h Road related functions. */
13 #include "direction_type.h"
14 #include "road_type.h"
15 #include "command_type.h"
17 void DrawRoadDepotSprite(int x
, int y
, DiagDirection dir
, RoadType rt
);
18 void UpdateNearestTownForRoadTiles(bool invalidate
);
20 CommandCost
CmdBuildLongRoad(DoCommandFlag flags
, TileIndex end_tile
, TileIndex start_tile
, RoadType rt
, Axis axis
, DisallowedRoadDirections drd
, bool start_half
, bool end_half
, bool is_ai
);
21 std::tuple
<CommandCost
, Money
> CmdRemoveLongRoad(DoCommandFlag flags
, TileIndex end_tile
, TileIndex start_tile
, RoadType rt
, Axis axis
, bool start_half
, bool end_half
);
22 CommandCost
CmdBuildRoad(DoCommandFlag flags
, TileIndex tile
, RoadBits pieces
, RoadType rt
, DisallowedRoadDirections toggle_drd
, TownID town_id
);
23 CommandCost
CmdBuildRoadDepot(DoCommandFlag flags
, TileIndex tile
, RoadType rt
, DiagDirection dir
);
24 CommandCost
CmdConvertRoad(DoCommandFlag flags
, TileIndex tile
, TileIndex area_start
, RoadType to_type
);
26 DEF_CMD_TRAIT(CMD_BUILD_LONG_ROAD
, CmdBuildLongRoad
, CMD_AUTO
| CMD_NO_WATER
| CMD_DEITY
, CMDT_LANDSCAPE_CONSTRUCTION
)
27 DEF_CMD_TRAIT(CMD_REMOVE_LONG_ROAD
, CmdRemoveLongRoad
, CMD_AUTO
| CMD_NO_TEST
, CMDT_LANDSCAPE_CONSTRUCTION
) // towns may disallow removing road bits (as they are connected) in test, but in exec they're removed and thus removing is allowed.
28 DEF_CMD_TRAIT(CMD_BUILD_ROAD
, CmdBuildRoad
, CMD_AUTO
| CMD_NO_WATER
| CMD_DEITY
, CMDT_LANDSCAPE_CONSTRUCTION
)
29 DEF_CMD_TRAIT(CMD_BUILD_ROAD_DEPOT
, CmdBuildRoadDepot
, CMD_AUTO
| CMD_NO_WATER
, CMDT_LANDSCAPE_CONSTRUCTION
)
30 DEF_CMD_TRAIT(CMD_CONVERT_ROAD
, CmdConvertRoad
, 0, CMDT_LANDSCAPE_CONSTRUCTION
)
32 CommandCallback CcPlaySound_CONSTRUCTION_OTHER
;
33 CommandCallback CcBuildRoadTunnel
;
34 void CcRoadDepot(Commands cmd
, const CommandCost
&result
, TileIndex tile
, RoadType rt
, DiagDirection dir
);
35 void CcRoadStop(Commands cmd
, const CommandCost
&result
, TileIndex tile
, uint8 width
, uint8 length
, RoadStopType
, bool is_drive_through
, DiagDirection dir
, RoadType
, StationID
, bool);
37 #endif /* ROAD_CMD_H */