truelight@9592: /* $Id$ */ truelight@9592: truebrain@9829: /** @file ai_tilelist.hpp List tiles. */ truelight@9592: truelight@9592: #ifndef AI_TILELIST_HPP truelight@9592: #define AI_TILELIST_HPP truelight@9592: truelight@9593: #include "ai_abstractlist.hpp" truebrain@9757: #include "../../industry.h" truelight@9592: truelight@9592: /** truebrain@9778: * Creates an empty list, in which you can add tiles. truebrain@9829: * @ingroup AIList truelight@9592: */ truelight@9593: class AITileList : public AIAbstractList { truelight@9592: public: truelight@9592: static const char *GetClassName() { return "AITileList"; } truelight@9592: truelight@9592: private: truebrain@9772: /** truelight@9592: * Make sure t1.x is smaller than t2.x and t1.y is smaller than t2.y. truelight@9592: * They are swapped to ensure they are after calling this function. truebrain@9778: * @param t1 one of the corners of the rectangle. truebrain@9778: * @param t2 the other corner of the rectangle. truelight@9592: */ truelight@9592: void FixRectangleSpan(TileIndex &t1, TileIndex &t2); truelight@9592: truelight@9592: public: truelight@9592: /** truelight@9592: * Adds the rectangle between tile_from and tile_to to the to-be-evaluated tiles. truebrain@9839: * @param tile_from One corner of the tiles to add. truebrain@9839: * @param tile_to The other corner of the tiles to add. truebrain@9801: * @pre AIMap::IsValidTile(tile_from). truebrain@9801: * @pre AIMap::IsValidTile(tile_to). truelight@9592: */ truelight@9592: void AddRectangle(TileIndex tile_from, TileIndex tile_to); truelight@9592: truelight@9592: /** truelight@9592: * Add a tile to the to-be-evaluated tiles. truebrain@9839: * @param tile The tile to add. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9592: */ truelight@9592: void AddTile(TileIndex tile); truelight@9592: truelight@9592: /** truelight@9592: * Remove the tiles inside the rectangle between tile_from and tile_to form the list. truebrain@9839: * @param tile_from One corner of the tiles to remove. truebrain@9839: * @param tile_to The other corner of the files to remove. truebrain@9801: * @pre AIMap::IsValidTile(tile_from). truebrain@9801: * @pre AIMap::IsValidTile(tile_to). truelight@9592: */ truelight@9592: void RemoveRectangle(TileIndex tile_from, TileIndex tile_to); truelight@9592: truelight@9592: /** truelight@9592: * Remove a tile from the list. truebrain@9839: * @param tile The tile to remove. truebrain@9801: * @pre AIMap::IsValidTile(tile). truelight@9592: */ truelight@9592: void RemoveTile(TileIndex tile); truelight@9592: }; truelight@9592: truebrain@9757: /** truebrain@9778: * Creates a list of tiles that will accept cargo for the given industry. truebrain@9778: * @note If a simular industry is close, it might happen that this industry receives the cargo. truebrain@9829: * @ingroup AIList truebrain@9757: */ truebrain@9757: class AITileList_IndustryAccepting : public AITileList { truebrain@9757: public: truebrain@9757: static const char *GetClassName() { return "AITileList_IndustryAccepting"; } truebrain@9757: truebrain@9757: /** truebrain@9778: * @param industry_id The industry to create the AITileList around. truebrain@9778: * @param radius The radius of the station you will be using. truebrain@9757: */ truebrain@9757: AITileList_IndustryAccepting(IndustryID industry_id, uint radius); truebrain@9757: }; truebrain@9757: truebrain@9757: /** truebrain@9778: * Creates a list of tiles which the industry checks to see if a station is truebrain@9778: * there to receive cargo produced by this industry. truebrain@9829: * @ingroup AIList truebrain@9757: */ truebrain@9757: class AITileList_IndustryProducing : public AITileList { truebrain@9757: public: truebrain@9757: static const char *GetClassName() { return "AITileList_IndustryProducing"; } truebrain@9757: truebrain@9757: /** truebrain@9778: * @param industry_id The industry to create the AITileList around. truebrain@9778: * @param radius The radius of the station you will be using. truebrain@9757: */ truebrain@9757: AITileList_IndustryProducing(IndustryID industry_id, uint radius); truebrain@9757: }; truebrain@9757: truelight@9592: #endif /* AI_TILELIST_HPP */