src/ai/api/ai_map.cpp
author truelight
Sun, 19 Aug 2007 13:31:04 +0000
branchnoai
changeset 9698 1d50fe99b7e9
parent 9655 e8e43f333832
child 9723 eee46cb39750
permissions -rw-r--r--
(svn r10939) [NoAI] -Add: added AITileList valuator Water
[NoAI] -Add: added AITile::IsWater
/* $Id$ */

/** @file ai_map.cpp handles the query-related of the AIMap class */

#include "ai_map.hpp"
#include "../../command.h"

/* static */ bool AIMap::IsValidTile(TileIndex t)
{
	return t < AIMap::GetMapSize();
}

/* static */ TileIndex AIMap::GetMapSize()
{
	return ::MapSize();
}

/* static */ uint32 AIMap::GetMapSizeX()
{
	return ::MapSizeX();
}

/* static */ uint32 AIMap::GetMapSizeY()
{
	return ::MapSizeY();
}

/* static */ uint32 AIMap::GetTileX(TileIndex t)
{
	return ::TileX(t);
}

/* static */ uint32 AIMap::GetTileY(TileIndex t)
{
	return ::TileY(t);
}

/* static */ TileIndex AIMap::GetTileIndex(uint32 x, uint32 y)
{
	return ::TileXY(x, y);
}

/* static */ uint32 AIMap::DistanceManhattan(TileIndex t1, TileIndex t2)
{
	return ::DistanceManhattan(t1, t2);
}

/* static */ uint32 AIMap::DistanceMax(TileIndex t1, TileIndex t2)
{
	return ::DistanceMax(t1, t2);
}

/* static */ uint32 AIMap::DistanceSquare(TileIndex t1, TileIndex t2)
{
	return ::DistanceSquare(t1, t2);
}

/* static */ uint32 AIMap::DistanceFromEdge(TileIndex t)
{
	return ::DistanceFromEdge(t);
}

bool AIMap::DemolishTile(TileIndex t)
{
	return this->DoCommand(t, 0, 0, CMD_LANDSCAPE_CLEAR);
}