src/ai/api/ai_tilelist_valuator.hpp
branchnoai
changeset 9772 c1035f0ac732
parent 9771 769496a7b02e
child 9778 38560cd27070
equal deleted inserted replaced
9771:769496a7b02e 9772:c1035f0ac732
    18 	 * The name of the class, needed by several sub-processes.
    18 	 * The name of the class, needed by several sub-processes.
    19 	 */
    19 	 */
    20 	static const char *GetClassName() { return "AITileList_vBuildable"; }
    20 	static const char *GetClassName() { return "AITileList_vBuildable"; }
    21 
    21 
    22 private:
    22 private:
       
    23 	/**
       
    24 	 * The name of this list, to check if we can be used with a List.
       
    25 	 */
       
    26 	const char *GetListName() const { return "AITileList"; }
       
    27 
    23 	int32 Valuate(int32 tile) const;
    28 	int32 Valuate(int32 tile) const;
    24 };
    29 };
    25 
    30 
    26 /**
    31 /**
    27  * Check if tiles are water-tiles for entries in an AITileList instance.
    32  * Check if tiles are water-tiles for entries in an AITileList instance.
    34 	 * The name of the class, needed by several sub-processes.
    39 	 * The name of the class, needed by several sub-processes.
    35 	 */
    40 	 */
    36 	static const char *GetClassName() { return "AITileList_vWater"; }
    41 	static const char *GetClassName() { return "AITileList_vWater"; }
    37 
    42 
    38 private:
    43 private:
       
    44 	/**
       
    45 	 * The name of this list, to check if we can be used with a List.
       
    46 	 */
       
    47 	const char *GetListName() const { return "AITileList"; }
       
    48 
    39 	int32 Valuate(int32 tile) const;
    49 	int32 Valuate(int32 tile) const;
    40 };
    50 };
    41 
    51 
    42 /**
    52 /**
    43  * Check if tiles are buildable in a rectangle around entries in an AITileList instance, with the entry in the list as top-left.
    53  * Check if tiles are buildable in a rectangle around entries in an AITileList instance, with the entry in the list as top-left.
    57 	AITileList_vBuildableRectangle(uint width, uint height) { this->width = width; this->height = height; }
    67 	AITileList_vBuildableRectangle(uint width, uint height) { this->width = width; this->height = height; }
    58 
    68 
    59 private:
    69 private:
    60 	uint width, height;
    70 	uint width, height;
    61 
    71 
       
    72 	/**
       
    73 	 * The name of this list, to check if we can be used with a List.
       
    74 	 */
       
    75 	const char *GetListName() const { return "AITileList"; }
       
    76 
    62 	int32 Valuate(int32 tile) const;
    77 	int32 Valuate(int32 tile) const;
    63 };
    78 };
    64 
    79 
    65 /**
    80 /**
    66  * Check how tiles in an AITileList instance are sloped.
    81  * Check how tiles in an AITileList instance are sloped.
    73 	 * The name of the class, needed by several sub-processes.
    88 	 * The name of the class, needed by several sub-processes.
    74 	 */
    89 	 */
    75 	static const char *GetClassName() { return "AITileList_vSlope"; }
    90 	static const char *GetClassName() { return "AITileList_vSlope"; }
    76 
    91 
    77 private:
    92 private:
       
    93 	/**
       
    94 	 * The name of this list, to check if we can be used with a List.
       
    95 	 */
       
    96 	const char *GetListName() const { return "AITileList"; }
       
    97 
    78 	int32 Valuate(int32 tile) const;
    98 	int32 Valuate(int32 tile) const;
    79 };
    99 };
    80 
   100 
    81 /**
   101 /**
    82  * Check the height of the tiles in an AITileList instance.
   102  * Check the height of the tiles in an AITileList instance.
    89 	 * The name of the class, needed by several sub-processes.
   109 	 * The name of the class, needed by several sub-processes.
    90 	 */
   110 	 */
    91 	static const char *GetClassName() { return "AITileList_vHeight"; }
   111 	static const char *GetClassName() { return "AITileList_vHeight"; }
    92 
   112 
    93 private:
   113 private:
       
   114 	/**
       
   115 	 * The name of this list, to check if we can be used with a List.
       
   116 	 */
       
   117 	const char *GetListName() const { return "AITileList"; }
       
   118 
    94 	int32 Valuate(int32 tile) const;
   119 	int32 Valuate(int32 tile) const;
    95 };
   120 };
    96 
   121 
    97 /**
   122 /**
    98  * Count for each entry in AITileList the amount of neighbours that contain road.
   123  * Count for each entry in AITileList the amount of neighbours that contain road.
   106 	 * The name of the class, needed by several sub-processes.
   131 	 * The name of the class, needed by several sub-processes.
   107 	 */
   132 	 */
   108 	static const char *GetClassName() { return "AITileList_vNeighbourRoad"; }
   133 	static const char *GetClassName() { return "AITileList_vNeighbourRoad"; }
   109 
   134 
   110 private:
   135 private:
       
   136 	/**
       
   137 	 * The name of this list, to check if we can be used with a List.
       
   138 	 */
       
   139 	const char *GetListName() const { return "AITileList"; }
       
   140 
   111 	int32 Valuate(int32 tile) const;
   141 	int32 Valuate(int32 tile) const;
   112 };
   142 };
   113 
   143 
   114 /**
   144 /**
   115  * Check if the tiles in AITileList have a piece of road on them.
   145  * Check if the tiles in AITileList have a piece of road on them.
   122 	 * The name of the class, needed by several sub-processes.
   152 	 * The name of the class, needed by several sub-processes.
   123 	 */
   153 	 */
   124 	static const char *GetClassName() { return "AITileList_vRoadTile"; }
   154 	static const char *GetClassName() { return "AITileList_vRoadTile"; }
   125 
   155 
   126 private:
   156 private:
       
   157 	/**
       
   158 	 * The name of this list, to check if we can be used with a List.
       
   159 	 */
       
   160 	const char *GetListName() const { return "AITileList"; }
       
   161 
   127 	int32 Valuate(int32 tile) const;
   162 	int32 Valuate(int32 tile) const;
   128 };
   163 };
   129 
   164 
   130 /**
   165 /**
   131  * Get the amount of estimated accepted cargo for all tiles in AITileList.
   166  * Get the amount of estimated accepted cargo for all tiles in AITileList.
   150 
   185 
   151 private:
   186 private:
   152 	CargoID cargo_type;
   187 	CargoID cargo_type;
   153 	uint width, height, radius;
   188 	uint width, height, radius;
   154 
   189 
       
   190 	/**
       
   191 	 * The name of this list, to check if we can be used with a List.
       
   192 	 */
       
   193 	const char *GetListName() const { return "AITileList"; }
       
   194 
   155 	int32 Valuate(int32 tile) const;
   195 	int32 Valuate(int32 tile) const;
   156 };
   196 };
   157 
   197 
   158 /**
   198 /**
   159  * Get the amount of tiles producing cargo for all tiles in AITileList.
   199  * Get the amount of tiles producing cargo for all tiles in AITileList.
   177 
   217 
   178 private:
   218 private:
   179 	CargoID cargo_type;
   219 	CargoID cargo_type;
   180 	uint width, height, radius;
   220 	uint width, height, radius;
   181 
   221 
       
   222 	/**
       
   223 	 * The name of this list, to check if we can be used with a List.
       
   224 	 */
       
   225 	const char *GetListName() const { return "AITileList"; }
       
   226 
   182 	int32 Valuate(int32 tile) const;
   227 	int32 Valuate(int32 tile) const;
   183 };
   228 };
   184 
   229 
   185 /**
   230 /**
   186  * Get the manhattan distance to a tile for entries in an AITileList instance.
   231  * Get the manhattan distance to a tile for entries in an AITileList instance.
   200 	AITileList_vDistanceManhattanToTile(TileIndex tile) { this->tile = tile; }
   245 	AITileList_vDistanceManhattanToTile(TileIndex tile) { this->tile = tile; }
   201 
   246 
   202 private:
   247 private:
   203 	TileIndex tile;
   248 	TileIndex tile;
   204 
   249 
       
   250 	/**
       
   251 	 * The name of this list, to check if we can be used with a List.
       
   252 	 */
       
   253 	const char *GetListName() const { return "AITileList"; }
       
   254 
   205 	int32 Valuate(int32 station) const;
   255 	int32 Valuate(int32 station) const;
   206 };
   256 };
   207 
   257 
   208 /**
   258 /**
   209  * Get the sqsuare distance to a tile for entries in an AITileList instance.
   259  * Get the sqsuare distance to a tile for entries in an AITileList instance.
   223 	AITileList_vDistanceSquareToTile(TileIndex tile) { this->tile = tile; }
   273 	AITileList_vDistanceSquareToTile(TileIndex tile) { this->tile = tile; }
   224 
   274 
   225 private:
   275 private:
   226 	TileIndex tile;
   276 	TileIndex tile;
   227 
   277 
       
   278 	/**
       
   279 	 * The name of this list, to check if we can be used with a List.
       
   280 	 */
       
   281 	const char *GetListName() const { return "AITileList"; }
       
   282 
   228 	int32 Valuate(int32 station) const;
   283 	int32 Valuate(int32 station) const;
   229 };
   284 };
   230 
   285 
   231 
   286 
   232 #endif /* AI_TILELIST_VALUATOR_HPP */
   287 #endif /* AI_TILELIST_VALUATOR_HPP */