src/ai/api/ai_station.hpp
branchnoai
changeset 10668 495789401303
parent 10644 6c4314786d68
child 10669 70a2d1f6f24b
equal deleted inserted replaced
10667:1bacf27342bd 10668:495789401303
     5 #ifndef AI_STATION_HPP
     5 #ifndef AI_STATION_HPP
     6 #define AI_STATION_HPP
     6 #define AI_STATION_HPP
     7 
     7 
     8 #include "ai_object.hpp"
     8 #include "ai_object.hpp"
     9 #include "ai_error.hpp"
     9 #include "ai_error.hpp"
       
    10 #include "ai_road.hpp"
    10 
    11 
    11 /**
    12 /**
    12  * Class that handles all station related functions.
    13  * Class that handles all station related functions.
    13  */
    14  */
    14 class AIStation : public AIObject {
    15 class AIStation : public AIObject {
   119 	/**
   120 	/**
   120 	 * Get the manhattan distance from the tile to the AIStation::GetLocation()
   121 	 * Get the manhattan distance from the tile to the AIStation::GetLocation()
   121 	 *  of the station.
   122 	 *  of the station.
   122 	 * @param station_id The station to get the distance to.
   123 	 * @param station_id The station to get the distance to.
   123 	 * @param tile The tile to get the distance to.
   124 	 * @param tile The tile to get the distance to.
       
   125 	 * @pre IsValidStation(station_id).
   124 	 * @return The distance between station and tile.
   126 	 * @return The distance between station and tile.
   125 	 */
   127 	 */
   126 	static int32 GetDistanceManhattanToTile(StationID station_id, TileIndex tile);
   128 	static int32 GetDistanceManhattanToTile(StationID station_id, TileIndex tile);
   127 
   129 
   128 	/**
   130 	/**
   129 	 * Get the square distance from the tile to the AIStation::GetLocation()
   131 	 * Get the square distance from the tile to the AIStation::GetLocation()
   130 	 *  of the station.
   132 	 *  of the station.
   131 	 * @param station_id The station to get the distance to.
   133 	 * @param station_id The station to get the distance to.
   132 	 * @param tile The tile to get the distance to.
   134 	 * @param tile The tile to get the distance to.
       
   135 	 * @pre IsValidStation(station_id).
   133 	 * @return The distance between station and tile.
   136 	 * @return The distance between station and tile.
   134 	 */
   137 	 */
   135 	static int32 GetDistanceSquareToTile(StationID station_id, TileIndex tile);
   138 	static int32 GetDistanceSquareToTile(StationID station_id, TileIndex tile);
   136 
   139 
   137 	/**
   140 	/**
   140 	 * @param station_id The station to check.
   143 	 * @param station_id The station to check.
   141 	 * @param town_id The town to check.
   144 	 * @param town_id The town to check.
   142 	 * @return True if the tile is within the rating influence of the town.
   145 	 * @return True if the tile is within the rating influence of the town.
   143 	 */
   146 	 */
   144 	static bool IsWithinTownInfluence(StationID station_id, TownID town_id);
   147 	static bool IsWithinTownInfluence(StationID station_id, TownID town_id);
       
   148 
       
   149 	/**
       
   150 	 * Check if any part of the station contains a station of the type
       
   151 	 *  RoadType.
       
   152 	 * @param road_type The RoadType to look for.
       
   153 	 * @return True if the station has a station part of the type RoadType.
       
   154 	 */
       
   155 	static bool HasRoadType(StationID station_id, AIRoad::RoadType road_type);
   145 };
   156 };
   146 
   157 
   147 DECLARE_ENUM_AS_BIT_SET(AIStation::StationType);
   158 DECLARE_ENUM_AS_BIT_SET(AIStation::StationType);
   148 
   159 
   149 #endif /* AI_STATION_HPP */
   160 #endif /* AI_STATION_HPP */