6 #define AI_INDUSTRYLIST_VALUATOR_HPP |
6 #define AI_INDUSTRYLIST_VALUATOR_HPP |
7 |
7 |
8 #include "ai_abstractlist.hpp" |
8 #include "ai_abstractlist.hpp" |
9 |
9 |
10 /** |
10 /** |
11 * Get the production of the cargo for entries in an AIIndustryList instance. |
11 * Get the production of the cargo for entries in an AIIndustryList_v instance. |
12 * @note resulting items are of the type int32 |
12 * @note resulting items are of the type int32 |
13 * @note the input items are of the type IndustryID |
13 * @note the input items are of the type IndustryID |
14 */ |
14 */ |
15 class AIIndustryListProduction : public AIAbstractList::Valuator { |
15 class AIIndustryList_vProduction : public AIAbstractList::Valuator { |
16 public: |
16 public: |
17 /** |
17 /** |
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 "AIIndustryListProduction"; } |
20 static const char *GetClassName() { return "AIIndustryList_vProduction"; } |
21 |
21 |
22 /** |
22 /** |
23 * Custom constructor, we want a cargo-type as parameter. |
23 * Custom constructor, we want a cargo-type as parameter. |
24 */ |
24 */ |
25 AIIndustryListProduction(CargoID cargo_type) { this->cargo_type = cargo_type; } |
25 AIIndustryList_vProduction(CargoID cargo_type) { this->cargo_type = cargo_type; } |
26 |
26 |
27 private: |
27 private: |
28 CargoID cargo_type; |
28 CargoID cargo_type; |
29 |
29 |
30 int32 Valuate(int32 industry) const; |
30 int32 Valuate(int32 industry) const; |
31 }; |
31 }; |
32 |
32 |
33 /** |
33 /** |
34 * See which entries in the AIIndustryList instance accepts a certain cargo. |
34 * See which entries in the AIIndustryList_v instance accepts a certain cargo. |
35 * @note resulting items are of the type bool |
35 * @note resulting items are of the type bool |
36 * @note the input items are of the type IndustryID |
36 * @note the input items are of the type IndustryID |
37 */ |
37 */ |
38 class AIIndustryListCargoAccepted : public AIAbstractList::Valuator { |
38 class AIIndustryList_vCargoAccepted : public AIAbstractList::Valuator { |
39 public: |
39 public: |
40 /** |
40 /** |
41 * The name of the class, needed by several sub-processes. |
41 * The name of the class, needed by several sub-processes. |
42 */ |
42 */ |
43 static const char *GetClassName() { return "AIIndustryListCargoAccepted"; } |
43 static const char *GetClassName() { return "AIIndustryList_vCargoAccepted"; } |
44 |
44 |
45 /** |
45 /** |
46 * Custom constructor, we want a cargo-type as parameter. |
46 * Custom constructor, we want a cargo-type as parameter. |
47 */ |
47 */ |
48 AIIndustryListCargoAccepted(CargoID cargo_type) { this->cargo_type = cargo_type; } |
48 AIIndustryList_vCargoAccepted(CargoID cargo_type) { this->cargo_type = cargo_type; } |
49 |
49 |
50 private: |
50 private: |
51 CargoID cargo_type; |
51 CargoID cargo_type; |
52 |
52 |
53 int32 Valuate(int32 industry) const; |
53 int32 Valuate(int32 industry) const; |
54 }; |
54 }; |
55 |
55 |
56 /** |
56 /** |
57 * Get the location for entries in an AIIndustryList instance. |
57 * Get the location for entries in an AIIndustryList_v instance. |
58 * @note resulting items are of the type TileIndex |
58 * @note resulting items are of the type TileIndex |
59 * @note the input items are of the type IndustryID |
59 * @note the input items are of the type IndustryID |
60 */ |
60 */ |
61 class AIIndustryListLocation : public AIAbstractList::Valuator { |
61 class AIIndustryList_vLocation : public AIAbstractList::Valuator { |
62 public: |
62 public: |
63 /** |
63 /** |
64 * The name of the class, needed by several sub-processes. |
64 * The name of the class, needed by several sub-processes. |
65 */ |
65 */ |
66 static const char *GetClassName() { return "AIIndustryListGetLocation"; } |
66 static const char *GetClassName() { return "AIIndustryList_vGetLocation"; } |
67 |
67 |
68 private: |
68 private: |
69 int32 Valuate(int32 industry) const; |
69 int32 Valuate(int32 industry) const; |
70 }; |
70 }; |
71 |
71 |
72 /** |
72 /** |
73 * Get the manhattan distance to a tile for entries in an AIIndustryList instance. |
73 * Get the manhattan distance to a tile for entries in an AIIndustryList_v instance. |
74 * @note resulting items are of the type distance |
74 * @note resulting items are of the type distance |
75 * @note the input items are of the type TileIndex |
75 * @note the input items are of the type TileIndex |
76 */ |
76 */ |
77 class AIIndustryListDistanceManhattanToTile : public AIAbstractList::Valuator { |
77 class AIIndustryList_vDistanceManhattanToTile : public AIAbstractList::Valuator { |
78 public: |
78 public: |
79 /** |
79 /** |
80 * The name of the class, needed by several sub-processes. |
80 * The name of the class, needed by several sub-processes. |
81 */ |
81 */ |
82 static const char *GetClassName() { return "AIIndustryListDistanceManhattanToTile"; } |
82 static const char *GetClassName() { return "AIIndustryList_vDistanceManhattanToTile"; } |
83 |
83 |
84 /** |
84 /** |
85 * Custom constructor, we want a tile as parameter. |
85 * Custom constructor, we want a tile as parameter. |
86 */ |
86 */ |
87 AIIndustryListDistanceManhattanToTile(TileIndex tile) { this->tile = tile; } |
87 AIIndustryList_vDistanceManhattanToTile(TileIndex tile) { this->tile = tile; } |
88 |
88 |
89 private: |
89 private: |
90 TileIndex tile; |
90 TileIndex tile; |
91 |
91 |
92 int32 Valuate(int32 station) const; |
92 int32 Valuate(int32 station) const; |
93 }; |
93 }; |
94 |
94 |
95 /** |
95 /** |
96 * Get the sqsuare distance to a tile for entries in an AIIndustryList instance. |
96 * Get the sqsuare distance to a tile for entries in an AIIndustryList_v instance. |
97 * @note resulting items are of the type distance |
97 * @note resulting items are of the type distance |
98 * @note the input items are of the type TileIndex |
98 * @note the input items are of the type TileIndex |
99 */ |
99 */ |
100 class AIIndustryListDistanceSquareToTile : public AIAbstractList::Valuator { |
100 class AIIndustryList_vDistanceSquareToTile : public AIAbstractList::Valuator { |
101 public: |
101 public: |
102 /** |
102 /** |
103 * The name of the class, needed by several sub-processes. |
103 * The name of the class, needed by several sub-processes. |
104 */ |
104 */ |
105 static const char *GetClassName() { return "AIIndustryListDistanceSquareToTile"; } |
105 static const char *GetClassName() { return "AIIndustryList_vDistanceSquareToTile"; } |
106 |
106 |
107 /** |
107 /** |
108 * Custom constructor, we want a tile as parameter. |
108 * Custom constructor, we want a tile as parameter. |
109 */ |
109 */ |
110 AIIndustryListDistanceSquareToTile(TileIndex tile) { this->tile = tile; } |
110 AIIndustryList_vDistanceSquareToTile(TileIndex tile) { this->tile = tile; } |
111 |
111 |
112 private: |
112 private: |
113 TileIndex tile; |
113 TileIndex tile; |
114 |
114 |
115 int32 Valuate(int32 station) const; |
115 int32 Valuate(int32 station) const; |