src/ai/api/ai_tilelist_valuator.hpp
branchnoai
changeset 9756 7e637829cbd3
parent 9753 7209db94ad12
child 9771 769496a7b02e
equal deleted inserted replaced
9755:d1d7e7738985 9756:7e637829cbd3
     6 #define AI_TILELIST_VALUATOR_HPP
     6 #define AI_TILELIST_VALUATOR_HPP
     7 
     7 
     8 #include "ai_abstractlist.hpp"
     8 #include "ai_abstractlist.hpp"
     9 
     9 
    10 /**
    10 /**
    11  * Check if tiles are buildable for entries in an AITileList_v instance.
    11  * Check if tiles are buildable for entries in an AITileList instance.
    12  * @note resulting items are of the type bool (0 = not buildable, 1 = buildable)
    12  * @note resulting items are of the type bool (0 = not buildable, 1 = buildable)
    13  * @note the input items are of the type TileIndex
    13  * @note the input items are of the type TileIndex
    14  */
    14  */
    15 class AITileList_vBuildable : public AIAbstractList::Valuator {
    15 class AITileList_vBuildable : public AIAbstractList::Valuator {
    16 public:
    16 public:
    22 private:
    22 private:
    23 	int32 Valuate(int32 tile) const;
    23 	int32 Valuate(int32 tile) const;
    24 };
    24 };
    25 
    25 
    26 /**
    26 /**
    27  * Check if tiles are water-tiles for entries in an AITileList_v instance.
    27  * Check if tiles are water-tiles for entries in an AITileList instance.
    28  * @note resulting items are of the type bool (0 = not water-tile, 1 = water-tile)
    28  * @note resulting items are of the type bool (0 = not water-tile, 1 = water-tile)
    29  * @note the input items are of the type TileIndex
    29  * @note the input items are of the type TileIndex
    30  */
    30  */
    31 class AITileList_vWater : public AIAbstractList::Valuator {
    31 class AITileList_vWater : public AIAbstractList::Valuator {
    32 public:
    32 public:
    38 private:
    38 private:
    39 	int32 Valuate(int32 tile) const;
    39 	int32 Valuate(int32 tile) const;
    40 };
    40 };
    41 
    41 
    42 /**
    42 /**
    43  * Check if tiles are buildable in a rectangle around entries in an AITileList_v instance, with the entry in the list as top-left.
    43  * Check if tiles are buildable in a rectangle around entries in an AITileList instance, with the entry in the list as top-left.
    44  * @note resulting items are of the type bool (0 = not buildable, 1 = buildable)
    44  * @note resulting items are of the type bool (0 = not buildable, 1 = buildable)
    45  * @note the input items are of the type TileIndex
    45  * @note the input items are of the type TileIndex
    46  */
    46  */
    47 class AITileList_vBuildableRectangle : public AIAbstractList::Valuator {
    47 class AITileList_vBuildableRectangle : public AIAbstractList::Valuator {
    48 public:
    48 public:
    61 
    61 
    62 	int32 Valuate(int32 tile) const;
    62 	int32 Valuate(int32 tile) const;
    63 };
    63 };
    64 
    64 
    65 /**
    65 /**
    66  * Check how tiles in an AITileList_v instance are sloped.
    66  * Check how tiles in an AITileList instance are sloped.
    67  * @note resulting items are of the type int32 (0 = flat, > 1 = slope)
    67  * @note resulting items are of the type int32 (0 = flat, > 1 = slope)
    68  * @note the input items are of the type TileIndex
    68  * @note the input items are of the type TileIndex
    69  */
    69  */
    70 class AITileList_vSlope : public AIAbstractList::Valuator {
    70 class AITileList_vSlope : public AIAbstractList::Valuator {
    71 public:
    71 public:
    77 private:
    77 private:
    78 	int32 Valuate(int32 tile) const;
    78 	int32 Valuate(int32 tile) const;
    79 };
    79 };
    80 
    80 
    81 /**
    81 /**
    82  * Check the height of the tiles in an AITileList_v instance.
    82  * Check the height of the tiles in an AITileList instance.
    83  * @note resulting items are of the type int32 (height, ranging from 0 to 15)
    83  * @note resulting items are of the type int32 (height, ranging from 0 to 15)
    84  * @note the input items are of the type TileIndex
    84  * @note the input items are of the type TileIndex
    85  */
    85  */
    86 class AITileList_vHeight : public AIAbstractList::Valuator {
    86 class AITileList_vHeight : public AIAbstractList::Valuator {
    87 public:
    87 public:
    93 private:
    93 private:
    94 	int32 Valuate(int32 tile) const;
    94 	int32 Valuate(int32 tile) const;
    95 };
    95 };
    96 
    96 
    97 /**
    97 /**
    98  * Count for each entry in AITileList_v the amount of neighbours that contain road.
    98  * Count for each entry in AITileList the amount of neighbours that contain road.
    99  *   This is a value between 0 and 4, as it only check horizontal and vertical.
    99  *   This is a value between 0 and 4, as it only check horizontal and vertical.
   100  * @note resulting items are of the type int32 (the amount of neighbour road tiles, value between 0 and 4)
   100  * @note resulting items are of the type int32 (the amount of neighbour road tiles, value between 0 and 4)
   101  * @note the input items are of the type TileIndex
   101  * @note the input items are of the type TileIndex
   102  */
   102  */
   103 class AITileList_vNeighbourRoadCount : public AIAbstractList::Valuator {
   103 class AITileList_vNeighbourRoadCount : public AIAbstractList::Valuator {
   110 private:
   110 private:
   111 	int32 Valuate(int32 tile) const;
   111 	int32 Valuate(int32 tile) const;
   112 };
   112 };
   113 
   113 
   114 /**
   114 /**
   115  * Check if the tiles in AITileList_v have a piece of road on them.
   115  * Check if the tiles in AITileList have a piece of road on them.
   116  * @note resulting items are of the type bool (0 = no road, 1 = road)
   116  * @note resulting items are of the type bool (0 = no road, 1 = road)
   117  * @note the input items are of the type TileIndex
   117  * @note the input items are of the type TileIndex
   118  */
   118  */
   119 class AITileList_vRoadTile : public AIAbstractList::Valuator {
   119 class AITileList_vRoadTile : public AIAbstractList::Valuator {
   120 public:
   120 public:
   154 
   154 
   155 	int32 Valuate(int32 tile) const;
   155 	int32 Valuate(int32 tile) const;
   156 };
   156 };
   157 
   157 
   158 /**
   158 /**
   159  * Get the manhattan distance to a tile for entries in an AITileList_v instance.
   159  * Get the manhattan distance to a tile for entries in an AITileList instance.
   160  * @note resulting items are of the type distance
   160  * @note resulting items are of the type distance
   161  * @note the input items are of the type TileIndex
   161  * @note the input items are of the type TileIndex
   162  */
   162  */
   163 class AITileList_vDistanceManhattanToTile : public AIAbstractList::Valuator {
   163 class AITileList_vDistanceManhattanToTile : public AIAbstractList::Valuator {
   164 public:
   164 public:
   177 
   177 
   178 	int32 Valuate(int32 station) const;
   178 	int32 Valuate(int32 station) const;
   179 };
   179 };
   180 
   180 
   181 /**
   181 /**
   182  * Get the sqsuare distance to a tile for entries in an AITileList_v instance.
   182  * Get the sqsuare distance to a tile for entries in an AITileList instance.
   183  * @note resulting items are of the type distance
   183  * @note resulting items are of the type distance
   184  * @note the input items are of the type TileIndex
   184  * @note the input items are of the type TileIndex
   185  */
   185  */
   186 class AITileList_vDistanceSquareToTile : public AIAbstractList::Valuator {
   186 class AITileList_vDistanceSquareToTile : public AIAbstractList::Valuator {
   187 public:
   187 public: