src/ai/api/ai_map.hpp
branchnoai
changeset 9502 5eb285182114
parent 9489 d7ee0a65ead9
child 9520 f7cf8bea10db
equal deleted inserted replaced
9501:15689f09d1f5 9502:5eb285182114
    55 	 * @pre t has to be valid (use IsValidTile(t)).
    55 	 * @pre t has to be valid (use IsValidTile(t)).
    56 	 * @return the Y-value.
    56 	 * @return the Y-value.
    57 	 * @post return value is lower than GetMapSizeY().
    57 	 * @post return value is lower than GetMapSizeY().
    58 	 */
    58 	 */
    59 	uint32 GetTileY(TileIndex t);
    59 	uint32 GetTileY(TileIndex t);
       
    60 
       
    61 	/**
       
    62 	 * Gets the TileIndex given a x,y-coordinate.
       
    63 	 * @param x the X coordinate.
       
    64 	 * @param y the Y coordinate.
       
    65 	 * @pre x has to be lower than GetMapSizeX().
       
    66 	 * @pre y has to be lower than GetMapSizeY().
       
    67 	 * @return the TileIndex for the given x,y coordinate.
       
    68 	 */
       
    69 	TileIndex GetTileIndex(uint32 x, uint32 y);
    60 
    70 
    61 	/**
    71 	/**
    62 	 * Calculates the Manhattan distance; the difference of
    72 	 * Calculates the Manhattan distance; the difference of
    63 	 * the X and Y added together.
    73 	 * the X and Y added together.
    64 	 * @param t1 the start.
    74 	 * @param t1 the start.
   120 	SQAIMap.DefSQFunction(engine, &AIMap::GetMapSize,        "GetMapSize");
   130 	SQAIMap.DefSQFunction(engine, &AIMap::GetMapSize,        "GetMapSize");
   121 	SQAIMap.DefSQFunction(engine, &AIMap::GetMapSizeX,       "GetMapSizeX");
   131 	SQAIMap.DefSQFunction(engine, &AIMap::GetMapSizeX,       "GetMapSizeX");
   122 	SQAIMap.DefSQFunction(engine, &AIMap::GetMapSizeY,       "GetMapSizeY");
   132 	SQAIMap.DefSQFunction(engine, &AIMap::GetMapSizeY,       "GetMapSizeY");
   123 	SQAIMap.DefSQFunction(engine, &AIMap::GetTileX,          "GetTileX");
   133 	SQAIMap.DefSQFunction(engine, &AIMap::GetTileX,          "GetTileX");
   124 	SQAIMap.DefSQFunction(engine, &AIMap::GetTileY,          "GetTileY");
   134 	SQAIMap.DefSQFunction(engine, &AIMap::GetTileY,          "GetTileY");
       
   135 	SQAIMap.DefSQFunction(engine, &AIMap::GetTileIndex,      "GetTileIndex");
   125 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceManhattan, "DistanceManhattan");
   136 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceManhattan, "DistanceManhattan");
   126 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceMax,       "DistanceMax");
   137 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceMax,       "DistanceMax");
   127 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceSquare,    "DistanceSquare");
   138 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceSquare,    "DistanceSquare");
   128 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceFromEdge,  "DistanceFromEdge");
   139 	SQAIMap.DefSQFunction(engine, &AIMap::DistanceFromEdge,  "DistanceFromEdge");
   129 	SQAIMap.PostRegister(engine);
   140 	SQAIMap.PostRegister(engine);