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 script_tilelist.hpp List tiles. */
10 #ifndef SCRIPT_TILELIST_HPP
11 #define SCRIPT_TILELIST_HPP
13 #include "script_station.hpp"
14 #include "script_list.hpp"
17 * Creates an empty list, in which you can add tiles.
21 class ScriptTileList
: public ScriptList
{
24 * Adds the rectangle between tile_from and tile_to to the to-be-evaluated tiles.
25 * @param tile_from One corner of the tiles to add.
26 * @param tile_to The other corner of the tiles to add.
27 * @pre ScriptMap::IsValidTile(tile_from).
28 * @pre ScriptMap::IsValidTile(tile_to).
30 void AddRectangle(TileIndex tile_from
, TileIndex tile_to
);
33 * Add a tile to the to-be-evaluated tiles.
34 * @param tile The tile to add.
35 * @pre ScriptMap::IsValidTile(tile).
37 void AddTile(TileIndex tile
);
40 * Remove the tiles inside the rectangle between tile_from and tile_to from the list.
41 * @param tile_from One corner of the tiles to remove.
42 * @param tile_to The other corner of the files to remove.
43 * @pre ScriptMap::IsValidTile(tile_from).
44 * @pre ScriptMap::IsValidTile(tile_to).
46 void RemoveRectangle(TileIndex tile_from
, TileIndex tile_to
);
49 * Remove a tile from the list.
50 * @param tile The tile to remove.
51 * @pre ScriptMap::IsValidTile(tile).
53 void RemoveTile(TileIndex tile
);
57 * Creates a list of tiles that will accept cargo for the given industry.
58 * @note If a simular industry is close, it might happen that this industry receives the cargo.
62 class ScriptTileList_IndustryAccepting
: public ScriptTileList
{
65 * @param industry_id The industry to create the ScriptTileList around.
66 * @param radius The coverage radius of the station type you will be using.
67 * @pre ScriptIndustry::IsValidIndustry(industry_id).
69 * @note A station part built on any of the returned tiles will give you coverage.
71 ScriptTileList_IndustryAccepting(IndustryID industry_id
, SQInteger radius
);
75 * Creates a list of tiles which the industry checks to see if a station is
76 * there to receive cargo produced by this industry.
80 class ScriptTileList_IndustryProducing
: public ScriptTileList
{
83 * @param industry_id The industry to create the ScriptTileList around.
84 * @param radius The coverage radius of the station type you will be using.
85 * @pre ScriptIndustry::IsValidIndustry(industry_id).
87 * @note A station part built on any of the returned tiles will give you acceptance.
89 ScriptTileList_IndustryProducing(IndustryID industry_id
, SQInteger radius
);
93 * Creates a list of tiles which have the requested StationType of the
98 class ScriptTileList_StationType
: public ScriptTileList
{
101 * @param station_id The station to create the ScriptTileList for.
102 * @param station_type The StationType to create the ScriptList for.
104 ScriptTileList_StationType(StationID station_id
, ScriptStation::StationType station_type
);
108 * Creates a list of tiles in the catchment area of the StationID.
110 * @ingroup ScriptList
112 class ScriptTileList_StationCoverage
: public ScriptTileList
{
115 * @param station_id The station to create the ScriptTileList for.
117 ScriptTileList_StationCoverage(StationID station_id
);
120 #endif /* SCRIPT_TILELIST_HPP */