From 9b6b2cabc187f3cb72a53d396418ab1b9ebd2933 Mon Sep 17 00:00:00 2001 From: truebrain Date: Mon, 19 Dec 2011 21:05:36 +0000 Subject: (svn r23633) -Add: allow most build commands from GameScript given a CompanyMode is active in that scope --- src/script/api/script_rail.hpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/script/api/script_rail.hpp') diff --git a/src/script/api/script_rail.hpp b/src/script/api/script_rail.hpp index f76d53531..21dfab356 100644 --- a/src/script/api/script_rail.hpp +++ b/src/script/api/script_rail.hpp @@ -203,9 +203,9 @@ public: * @pre ScriptMap::IsValidTile(start_tile). * @pre ScriptMap::IsValidTile(end_tile). * @pre IsRailTypeAvailable(convert_to). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptRail::ERR_UNSUITABLE_TRACK * @return Whether at least some rail has been converted successfully. - * @api -game */ static bool ConvertRailType(TileIndex start_tile, TileIndex end_tile, ScriptRail::RailType convert_to); @@ -233,10 +233,10 @@ public: * @pre ScriptMap::IsValidTile(front). * @pre 'tile' is not equal to 'front', but in a straight line of it. * @pre IsRailTypeAvailable(GetCurrentRailType()). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptError::ERR_FLAT_LAND_REQUIRED * @exception ScriptError::ERR_AREA_NOT_CLEAR * @return Whether the rail depot has been/can be build or not. - * @api -game */ static bool BuildRailDepot(TileIndex tile, TileIndex front); @@ -253,6 +253,7 @@ public: * @pre num_platforms > 0 && num_platforms <= 255. * @pre platform_length > 0 && platform_length <= 255. * @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception ScriptError::ERR_AREA_NOT_CLEAR * @exception ScriptError::ERR_FLAT_LAND_REQUIRED @@ -260,7 +261,6 @@ public: * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN * @return Whether the station has been/can be build or not. - * @api -game */ static bool BuildRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id); @@ -287,6 +287,7 @@ public: * @pre ScriptCargo::IsValidCargo(cargo_type) * @pre source_industry == ScriptIndustryType::INDUSTRYTYPE_UNKNOWN || source_industry == ScriptIndustryType::INDUSTRYTYPE_TOWN || ScriptIndustryType::IsValidIndustryType(source_industry). * @pre goal_industry == ScriptIndustryType::INDUSTRYTYPE_UNKNOWN || goal_industry == ScriptIndustryType::INDUSTRYTYPE_TOWN || ScriptIndustryType::IsValidIndustryType(goal_industry). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY * @exception ScriptError::ERR_AREA_NOT_CLEAR * @exception ScriptError::ERR_FLAT_LAND_REQUIRED @@ -294,7 +295,6 @@ public: * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN * @return Whether the station has been/can be build or not. - * @api -game */ static bool BuildNewGRFRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station); @@ -305,9 +305,9 @@ public: * @pre IsRailTile(tile). * @pre GetRailTracks(tile) == RAILTRACK_NE_SW || GetRailTracks(tile) == RAILTRACK_NW_SE. * @pre IsRailTypeAvailable(GetCurrentRailType()). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptError::ERR_FLAT_LAND_REQUIRED * @return Whether the rail waypoint has been/can be build or not. - * @api -game */ static bool BuildRailWaypoint(TileIndex tile); @@ -318,8 +318,8 @@ public: * @param keep_rail Whether to keep the rail after removal. * @pre IsValidTile(tile). * @pre IsValidTile(tile2). + * @game @pre Valid ScriptCompanyMode active in scope. * @return Whether at least one tile has been/can be cleared or not. - * @api -game */ static bool RemoveRailWaypointTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail); @@ -330,8 +330,8 @@ public: * @param keep_rail Whether to keep the rail after removal. * @pre IsValidTile(tile). * @pre IsValidTile(tile2). + * @game @pre Valid ScriptCompanyMode active in scope. * @return Whether at least one tile has been/can be cleared or not. - * @api -game */ static bool RemoveRailStationTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail); @@ -350,6 +350,7 @@ public: * @param rail_track The RailTrack to build. * @pre ScriptMap::IsValidTile(tile). * @pre IsRailTypeAvailable(GetCurrentRailType()). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptError::ERR_AREA_NOT_CLEAR * @exception ScriptError::ERR_LAND_SLOPED_WRONG * @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS @@ -358,7 +359,6 @@ public: * @return Whether the rail has been/can be build or not. * @note You can only build a single track with this function so do not * use the values from RailTrack as bitmask. - * @api -game */ static bool BuildRailTrack(TileIndex tile, RailTrack rail_track); @@ -368,10 +368,10 @@ public: * @param rail_track The RailTrack to remove. * @pre ScriptMap::IsValidTile(tile). * @pre (GetRailTracks(tile) & rail_track) != 0. + * @game @pre Valid ScriptCompanyMode active in scope. * @return Whether the rail has been/can be removed or not. * @note You can only remove a single track with this function so do not * use the values from RailTrack as bitmask. - * @api -game */ static bool RemoveRailTrack(TileIndex tile, RailTrack rail_track); @@ -400,6 +400,7 @@ public: * (ScriptMap::GetTileX(from) == ScriptMap::GetTileX(tile) && ScriptMap::GetTileX(tile) == ScriptMap::GetTileX(to)) || * (ScriptMap::GetTileY(from) == ScriptMap::GetTileY(tile) && ScriptMap::GetTileY(tile) == ScriptMap::GetTileY(to)). * @pre IsRailTypeAvailable(GetCurrentRailType()). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptError::ERR_AREA_NOT_CLEAR * @exception ScriptError::ERR_LAND_SLOPED_WRONG * @exception ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD @@ -407,7 +408,6 @@ public: * @exception ScriptError::ERR_ALREADY_BUILT * @note Construction will fail if an obstacle is found between the start and end tiles. * @return Whether the rail has been/can be build or not. - * @api -game */ static bool BuildRail(TileIndex from, TileIndex tile, TileIndex to); @@ -423,8 +423,8 @@ public: * abs(ScriptMap::GetTileY(to) - ScriptMap::GetTileY(tile))) <= 1) || * (ScriptMap::GetTileX(from) == ScriptMap::GetTileX(tile) && ScriptMap::GetTileX(tile) == ScriptMap::GetTileX(to)) || * (ScriptMap::GetTileY(from) == ScriptMap::GetTileY(tile) && ScriptMap::GetTileY(tile) == ScriptMap::GetTileY(to)). + * @game @pre Valid ScriptCompanyMode active in scope. * @return Whether the rail has been/can be removed or not. - * @api -game */ static bool RemoveRail(TileIndex from, TileIndex tile, TileIndex to); @@ -444,9 +444,9 @@ public: * @param signal The SignalType to build. * @pre ScriptMap::DistanceManhattan(tile, front) == 1. * @pre IsRailTile(tile) && !IsRailStationTile(tile) && !IsRailWaypointTile(tile). + * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptRail::ERR_UNSUITABLE_TRACK * @return Whether the signal has been/can be build or not. - * @api -game */ static bool BuildSignal(TileIndex tile, TileIndex front, SignalType signal); @@ -456,8 +456,8 @@ public: * @param front The tile in front of the signal. * @pre ScriptMap::DistanceManhattan(tile, front) == 1. * @pre GetSignalType(tile, front) != SIGNALTYPE_NONE. + * @game @pre Valid ScriptCompanyMode active in scope. * @return Whether the signal has been/can be removed or not. - * @api -game */ static bool RemoveSignal(TileIndex tile, TileIndex front); -- cgit v1.2.3-54-g00ecf