src/ai/api/ai_town.hpp
branchnoai
changeset 10840 fd5945ab9ea6
parent 10361 4cdffd48480f
child 10841 a8942f5f7e3b
equal deleted inserted replaced
10831:f7e17819358b 10840:fd5945ab9ea6
    44 	 */
    44 	 */
    45 	static char *GetName(TownID town_id);
    45 	static char *GetName(TownID town_id);
    46 
    46 
    47 	/**
    47 	/**
    48 	 * Gets the number of inhabitants in the town.
    48 	 * Gets the number of inhabitants in the town.
    49 	 * @param town_id The town to get the name of.
    49 	 * @param town_id The town to get the population of.
    50 	 * @pre IsValidTown(town_id).
    50 	 * @pre IsValidTown(town_id).
    51 	 * @return The number of inhabitants.
    51 	 * @return The number of inhabitants.
    52 	 * @post Return value is always non-negative.
    52 	 * @post Return value is always non-negative.
    53 	 */
    53 	 */
    54 	static int32 GetPopulation(TownID town_id);
    54 	static int32 GetPopulation(TownID town_id);
       
    55 
       
    56 	/**
       
    57 	 * Gets the number of houses in the town.
       
    58 	 * @param town_id The town to get the number of houses of.
       
    59 	 * @pre IsValidTown(town_id).
       
    60 	 * @return The number of houses.
       
    61 	 * @post Return value is always non-negative.
       
    62 	 */
       
    63 	static int32 GetNumHouses(TownID town_id);
    55 
    64 
    56 	/**
    65 	/**
    57 	 * Gets the location of the town.
    66 	 * Gets the location of the town.
    58 	 * @param town_id The location of the town.
    67 	 * @param town_id The location of the town.
    59 	 * @pre IsValidTown(town_id).
    68 	 * @pre IsValidTown(town_id).
    60 	 * @return The location of the town.
    69 	 * @return The location of the town.
    61 	 */
    70 	 */
    62 	static TileIndex GetLocation(TownID town_id);
    71 	static TileIndex GetLocation(TownID town_id);
       
    72 
       
    73 	/**
       
    74 	 * Get the total last month's production of the given cargo at a town.
       
    75 	 * @param town_id The index of the town.
       
    76 	 * @param cargo_id The index of the cargo.
       
    77 	 * @pre IsValidTown(town_id).
       
    78 	 * @pre AICargo::IsValidCargo(cargo_id).
       
    79 	 * @pre AICargo::GetTownEffect(cargo_id) == TE_PASSENGERS || AICargo::GetTownEffect(cargo_id) == TE_MAIL.
       
    80 	 * @return The last month's production of the given cargo for this town.
       
    81 	 * @post Return value is always non-negative.
       
    82 	 */
       
    83 	static int32 GetLastMonthProduction(TownID town_id, CargoID cargo_id);
       
    84 
       
    85 	/**
       
    86 	 * Get the total amount of cargo transported from a town last month.
       
    87 	 * @param town_id The index of the industry.
       
    88 	 * @param cargo_id The index of the cargo.
       
    89 	 * @pre IsValidTown(town_id).
       
    90 	 * @pre AICargo::IsValidCargo(cargo_id).
       
    91 	 * @pre AICargo::GetTownEffect(cargo_id) == TE_PASSENGERS || AICargo::GetTownEffect(cargo_id) == TE_MAIL.
       
    92 	 * @return The amount of given cargo transported from this town last month.
       
    93 	 * @post Return value is always non-negative.
       
    94 	 */
       
    95 	static int32 GetLastMonthTransported(TownID town_id, CargoID cargo_id);
       
    96 
       
    97 	/**
       
    98 	 * Get the maximum production of the given cargo at a town.
       
    99 	 * @param town_id The index of the town.
       
   100 	 * @param cargo_id The index of the cargo.
       
   101 	 * @pre IsValidTown(town_id).
       
   102 	 * @pre AICargo::IsValidCargo(cargo_id).
       
   103 	 * @pre AICargo::GetTownEffect(cargo_id) == TE_PASSENGERS || AICargo::GetTownEffect(cargo_id) == TE_MAIL.
       
   104 	 * @return The maximum production of the given cargo for this town.
       
   105 	 * @post Return value is always non-negative.
       
   106 	 */
       
   107 	static int32 GetMaxProduction(TownID town_id, CargoID cargo_id);
    63 
   108 
    64 	/**
   109 	/**
    65 	 * Get the manhattan distance from the tile to the AITown::GetLocation()
   110 	 * Get the manhattan distance from the tile to the AITown::GetLocation()
    66 	 *  of the town.
   111 	 *  of the town.
    67 	 * @param town_id The town to get the distance to.
   112 	 * @param town_id The town to get the distance to.