126 private: |
126 private: |
127 int32 Valuate(int32 tile) const; |
127 int32 Valuate(int32 tile) const; |
128 }; |
128 }; |
129 |
129 |
130 /** |
130 /** |
131 * Get the amount of estimated accepted cargo for all tiles in AITileList_v. |
131 * Get the amount of estimated accepted cargo for all tiles in AITileList. |
132 * If this value is >= 8, it means it will accept this cargo. For passengers |
132 * If this value is >= 8, it means it will accept this cargo. For passengers |
133 * and mail it is also a good indicator how much cargo would be brought to |
133 * and mail it is also a good indicator how much cargo would be brought to |
134 * the station. |
134 * the station. |
135 * @post values < 8 means this tile does not accept this cargo. |
135 * @post values < 8 means this tile does not accept this cargo. |
136 * @note resulting items are of the type int32 (indicating acceptance) |
136 * @note resulting items are of the type int32 (indicating acceptance) |
154 |
154 |
155 int32 Valuate(int32 tile) const; |
155 int32 Valuate(int32 tile) const; |
156 }; |
156 }; |
157 |
157 |
158 /** |
158 /** |
|
159 * Get the amount of tiles producing cargo for all tiles in AITileList. |
|
160 * This counts the tiles that produce this cargo. It doesn't give any |
|
161 * indication about the amount it will be producing. |
|
162 * @note town(houses) are not included in the value. |
|
163 * @note resulting items are of the type int32 (indicating tiles of production). |
|
164 * @note the input items are of the type TileIndex. |
|
165 */ |
|
166 class AITileList_vCargoProduction : public AIAbstractList::Valuator { |
|
167 public: |
|
168 /** |
|
169 * The name of the class, needed by several sub-processes. |
|
170 */ |
|
171 static const char *GetClassName() { return "AITileList_vCargoProduction"; } |
|
172 |
|
173 /** |
|
174 * Custom constructor, we want a cargo-type as parameter. |
|
175 */ |
|
176 AITileList_vCargoProduction(CargoID cargo_type, uint width, uint height, uint radius) { this->cargo_type = cargo_type; this->width = width; this->height = height; this->radius = radius; } |
|
177 |
|
178 private: |
|
179 CargoID cargo_type; |
|
180 uint width, height, radius; |
|
181 |
|
182 int32 Valuate(int32 tile) const; |
|
183 }; |
|
184 |
|
185 /** |
159 * Get the manhattan distance to a tile for entries in an AITileList instance. |
186 * Get the manhattan distance to a tile for entries in an AITileList instance. |
160 * @note resulting items are of the type distance |
187 * @note resulting items are of the type distance |
161 * @note the input items are of the type TileIndex |
188 * @note the input items are of the type TileIndex |
162 */ |
189 */ |
163 class AITileList_vDistanceManhattanToTile : public AIAbstractList::Valuator { |
190 class AITileList_vDistanceManhattanToTile : public AIAbstractList::Valuator { |