2009-08-21 20:21:05 +00:00
/*
* This file is part of OpenTTD .
* 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.
* 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 .
* 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/>.
*/
2008-05-06 15:11:33 +00:00
/** @file road_cmd.h Road related functions. */
2007-03-28 20:41:35 +00:00
2006-08-03 06:44:54 +00:00
# ifndef ROAD_CMD_H
# define ROAD_CMD_H
2007-12-18 19:52:14 +00:00
# include "direction_type.h"
2010-01-15 16:41:15 +00:00
# include "road_type.h"
2021-10-05 20:02:27 +00:00
# include "command_type.h"
2006-08-03 06:44:54 +00:00
2007-05-21 21:58:31 +00:00
void DrawRoadDepotSprite ( int x , int y , DiagDirection dir , RoadType rt ) ;
2009-07-05 13:21:51 +00:00
void UpdateNearestTownForRoadTiles ( bool invalidate ) ;
2006-08-03 06:44:54 +00:00
2021-11-14 23:03:01 +00:00
CommandCost CmdBuildLongRoad ( DoCommandFlag flags , TileIndex start_tile , TileIndex end_tile , RoadType rt , Axis axis , DisallowedRoadDirections drd , bool start_half , bool end_half , bool is_ai ) ;
2021-11-30 23:17:05 +00:00
std : : tuple < CommandCost , Money > CmdRemoveLongRoad ( DoCommandFlag flags , TileIndex start_tile , TileIndex end_tile , RoadType rt , Axis axis , bool start_half , bool end_half ) ;
2021-11-14 23:03:01 +00:00
CommandCost CmdBuildRoad ( DoCommandFlag flags , TileIndex tile , RoadBits pieces , RoadType rt , DisallowedRoadDirections toggle_drd , TownID town_id ) ;
2021-11-14 15:39:17 +00:00
CommandCost CmdBuildRoadDepot ( DoCommandFlag flags , TileIndex tile , RoadType rt , DiagDirection dir ) ;
2021-11-14 23:03:01 +00:00
CommandCost CmdConvertRoad ( DoCommandFlag flags , TileIndex tile , TileIndex area_start , RoadType to_type ) ;
2021-10-05 20:02:27 +00:00
DEF_CMD_TRAIT ( CMD_BUILD_LONG_ROAD , CmdBuildLongRoad , CMD_AUTO | CMD_NO_WATER | CMD_DEITY , CMDT_LANDSCAPE_CONSTRUCTION )
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.
DEF_CMD_TRAIT ( CMD_BUILD_ROAD , CmdBuildRoad , CMD_AUTO | CMD_NO_WATER | CMD_DEITY , CMDT_LANDSCAPE_CONSTRUCTION )
DEF_CMD_TRAIT ( CMD_BUILD_ROAD_DEPOT , CmdBuildRoadDepot , CMD_AUTO | CMD_NO_WATER , CMDT_LANDSCAPE_CONSTRUCTION )
DEF_CMD_TRAIT ( CMD_CONVERT_ROAD , CmdConvertRoad , 0 , CMDT_LANDSCAPE_CONSTRUCTION )
2021-10-10 00:35:06 +00:00
CommandCallback CcPlaySound_CONSTRUCTION_OTHER ;
CommandCallback CcBuildRoadTunnel ;
2021-11-28 21:43:38 +00:00
void CcRoadDepot ( Commands cmd , const CommandCost & result , TileIndex tile , RoadType rt , DiagDirection dir ) ;
void CcRoadStop ( Commands cmd , const CommandCost & result , TileIndex tile , uint8 width , uint8 length , RoadStopType , bool is_drive_through , DiagDirection dir , RoadType , StationID , bool ) ;
2021-10-10 00:35:06 +00:00
2006-09-28 18:42:35 +00:00
# endif /* ROAD_CMD_H */