(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
/* $Id$ */
/** @file ai_tile.cpp handles the functions of the AITile class */
#include "ai_tile.hpp"
#include "../../tile.h"
#include "../../variables.h"
#include "../../station.h"
bool AITile::IsBuildable(TileIndex tile)
{
/* Outside of the map */
if (tile >= ::MapSize()) return false;
switch (::GetTileType(tile)) {
default: return 1;
case MP_VOID:
case MP_HOUSE:
case MP_STATION:
case MP_INDUSTRY:
case MP_UNMOVABLE: return 0;
}
}
int32 AITile::GetSlope(TileIndex tile)
{
/* Outside of the map */
if (tile >= ::MapSize()) return 0;
return GetTileSlope(tile, NULL);
}
int32 AITile::GetCargoAcceptance(TileIndex tile, CargoID cargo_type, uint width, uint height, uint rad)
{
/* Outside of the map */
if (tile >= ::MapSize()) return false;
AcceptedCargo accepts;
GetAcceptanceAroundTiles(accepts, tile, width, height, _patches.modified_catchment ? rad : 4);
return accepts[cargo_type];
}