src/ai/api/ai_map.hpp
branchnoai
changeset 9448 2a4c4340233d
parent 9427 ef0c109c5661
child 9489 d7ee0a65ead9
equal deleted inserted replaced
9447:8f3c1bc72204 9448:2a4c4340233d
     5 #ifndef AI_MAP_HPP
     5 #ifndef AI_MAP_HPP
     6 #define AI_MAP_HPP
     6 #define AI_MAP_HPP
     7 
     7 
     8 #include "ai_object.hpp"
     8 #include "ai_object.hpp"
     9 
     9 
       
    10 /**
       
    11  * Class that handles all map related functions.
       
    12  */
    10 class AIMap : public AIObject {
    13 class AIMap : public AIObject {
    11 public:
    14 public:
    12 	/**
    15 	/**
    13 	 * Checks whether the given tile is valid
    16 	 * Checks whether the given tile is valid.
    14 	 * @param t the tile to check
    17 	 * @param t the tile to check.
    15 	 * @return true is the tile it within the boundaries of the map
    18 	 * @return true is the tile it within the boundaries of the map.
    16 	 */
    19 	 */
    17 	bool IsValidTile(TileIndex t);
    20 	bool IsValidTile(TileIndex t);
    18 
    21 
    19 	/**
    22 	/**
    20 	 * Gets the number of tiles in the map
    23 	 * Gets the number of tiles in the map.
    21 	 * @return the size of the map in tiles
    24 	 * @return the size of the map in tiles.
    22 	 * @post return > 0
    25 	 * @post return value is always positive.
    23 	 */
    26 	 */
    24 	TileIndex GetMapSize();
    27 	TileIndex GetMapSize();
    25 
    28 
    26 	/**
    29 	/**
    27 	 * Gets the amount of tiles along the SW and NE border
    30 	 * Gets the amount of tiles along the SW and NE border.
    28 	 * @return the length along the SW and NE borders
    31 	 * @return the length along the SW and NE borders.
    29 	 * @post return > 0
    32 	 * @post return value is always positive.
    30 	 */
    33 	 */
    31 	uint32 GetMapSizeX();
    34 	uint32 GetMapSizeX();
    32 
    35 
    33 	/**
    36 	/**
    34 	 * Gets the amount of tiles along the SE and NW border
    37 	 * Gets the amount of tiles along the SE and NW border.
    35 	 * @return the length along the SE and NW borders
    38 	 * @return the length along the SE and NW borders.
    36 	 * @post return > 0
    39 	 * @post return value is always positive.
    37 	 */
    40 	 */
    38 	uint32 GetMapSizeY();
    41 	uint32 GetMapSizeY();
    39 
    42 
    40 	/**
    43 	/**
    41 	 * Gets the X (place along the SW/NE border)
    44 	 * Gets the place along the SW/NE border (X-value).
    42 	 * @param t the tile to get the X of
    45 	 * @param t the tile to get the X-value of.
    43 	 * @pre this->IsValidTile(t)
    46 	 * @pre t has to be valid (use IsValidTile(t)).
    44 	 * @return the x-position
    47 	 * @return the X-value.
    45 	 * @post return <= this->GetMapSizeX()
    48 	 * @post return value is lower than GetMapSizeX().
    46 	 */
    49 	 */
    47 	uint32 GetTileX(TileIndex t);
    50 	uint32 GetTileX(TileIndex t);
    48 
    51 
    49 	/**
    52 	/**
    50 	 * Gets the Y (place along the SE/NW border)
    53 	 * Gets the place along the SE/NW border (Y-value).
    51 	 * @param t the tile to get the Y of
    54 	 * @param t the tile to get the Y-value of.
    52 	 * @pre this->IsValidTile(t)
    55 	 * @pre t has to be valid (use IsValidTile(t)).
    53 	 * @return the y-position
    56 	 * @return the Y-value.
    54 	 * @post return <= this->GetMapSizeY()
    57 	 * @post return value is lower than GetMapSizeY().
    55 	 */
    58 	 */
    56 	uint32 GetTileY(TileIndex t);
    59 	uint32 GetTileY(TileIndex t);
    57 };
    60 };
    58 
    61 
    59 #ifdef DEFINE_SQUIRREL_CLASS
    62 #ifdef DEFINE_SQUIRREL_CLASS