src/ai/api/ai_map.cpp
branchnoai
changeset 9489 d7ee0a65ead9
parent 9430 9e0a193b2bec
child 9502 5eb285182114
equal deleted inserted replaced
9488:1f7ade62b443 9489:d7ee0a65ead9
     1 /* $Id$ */
     1 /* $Id$ */
     2 
     2 
     3 /** @file ai_map.cpp handles the query-related of the AIMap class */
     3 /** @file ai_map.cpp handles the query-related of the AIMap class */
     4 
     4 
     5 #include "ai_map.hpp"
     5 #include "ai_map.hpp"
       
     6 #include "../../command.h"
     6 
     7 
     7 bool AIMap::IsValidTile(TileIndex t)
     8 bool AIMap::IsValidTile(TileIndex t)
     8 {
     9 {
     9 	return t < this->GetMapSize();
    10 	return t < this->GetMapSize();
    10 }
    11 }
    31 
    32 
    32 uint32 AIMap::GetTileY(TileIndex t)
    33 uint32 AIMap::GetTileY(TileIndex t)
    33 {
    34 {
    34 	return ::TileY(t);
    35 	return ::TileY(t);
    35 }
    36 }
       
    37 
       
    38 uint32 AIMap::DistanceManhattan(TileIndex t1, TileIndex t2)
       
    39 {
       
    40 	return ::DistanceManhattan(t1, t2);
       
    41 }
       
    42 
       
    43 uint32 AIMap::DistanceMax(TileIndex t1, TileIndex t2)
       
    44 {
       
    45 	return ::DistanceMax(t1, t2);
       
    46 }
       
    47 
       
    48 uint32 AIMap::DistanceSquare(TileIndex t1, TileIndex t2)
       
    49 {
       
    50 	return ::DistanceSquare(t1, t2);
       
    51 }
       
    52 
       
    53 uint32 AIMap::DistanceFromEdge(TileIndex t)
       
    54 {
       
    55 	return ::DistanceFromEdge(t);
       
    56 }
       
    57 
       
    58 bool AIMap::DemolishTile(TileIndex t)
       
    59 {
       
    60 	return this->DoCommand(t, 0, 0, CMD_LANDSCAPE_CLEAR);
       
    61 }