src/ai/api/ai_map.cpp
author rubidium
Sat, 14 Apr 2007 20:38:10 +0000
branchnoai
changeset 9594 5009a30f320a
parent 9502 5eb285182114
child 9655 e8e43f333832
permissions -rw-r--r--
(svn r9627) [NoAI] -Fix: let the squirrel export script export all needed (and a few more) types of references to structs and classes.
/* $Id$ */

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

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

bool AIMap::IsValidTile(TileIndex t)
{
	return t < this->GetMapSize();
}

TileIndex AIMap::GetMapSize()
{
	return ::MapSize();
}

uint32 AIMap::GetMapSizeX()
{
	return ::MapSizeX();
}

uint32 AIMap::GetMapSizeY()
{
	return ::MapSizeY();
}

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

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

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

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

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

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

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

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