author | truelight |
Wed, 18 Jul 2007 08:38:50 +0000 | |
branch | noai |
changeset 9669 | 366771e15a2c |
parent 9658 | e7675771bca4 |
child 9678 | c78400096127 |
permissions | -rw-r--r-- |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
1 |
/* $Id$ */ |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
2 |
|
9595
91423dbb6f5f
(svn r9628) [NoAI] -Fix: missing svn:eol-style and svn:keywords
rubidium
parents:
9594
diff
changeset
|
3 |
/** @file ai_tilelist_valuator.hpp all the valuators for tilelist */ |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
4 |
|
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
5 |
#ifndef AI_TILELIST_VALUATOR_HPP |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
6 |
#define AI_TILELIST_VALUATOR_HPP |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
7 |
|
9593
012f29f59906
(svn r9626) [NoAI] -Change: renamed AIList to AIAbstractList and hide 'AddItem' and 'RemoveItem'
truelight
parents:
9592
diff
changeset
|
8 |
#include "ai_abstractlist.hpp" |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
9 |
|
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
10 |
/** |
9603
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
11 |
* Check if tiles are buildable for entries in an AITileList instance. |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
12 |
* @note resulting items are of the type bool (0 = not buildable, 1 = buildable) |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
13 |
* @note the input items are of the type TileIndex |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
14 |
*/ |
9593
012f29f59906
(svn r9626) [NoAI] -Change: renamed AIList to AIAbstractList and hide 'AddItem' and 'RemoveItem'
truelight
parents:
9592
diff
changeset
|
15 |
class AITileListBuildable : public AIAbstractList::Valuator { |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
16 |
public: |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
17 |
/** |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
18 |
* The name of the class, needed by several sub-processes. |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
19 |
*/ |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
20 |
static const char *GetClassName() { return "AITileListBuildable"; } |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
21 |
|
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
22 |
private: |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
23 |
int32 Valuate(int32 tile) const; |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
24 |
}; |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
25 |
|
9603
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
26 |
/** |
9657
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
27 |
* Check if tiles are buildable in a rectangle around entries in an AITileList instance, with the entry in the list as top-left. |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
28 |
* @note resulting items are of the type bool (0 = not buildable, 1 = buildable) |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
29 |
* @note the input items are of the type TileIndex |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
30 |
*/ |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
31 |
class AITileListBuildableRectangle : public AIAbstractList::Valuator { |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
32 |
public: |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
33 |
/** |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
34 |
* The name of the class, needed by several sub-processes. |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
35 |
*/ |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
36 |
static const char *GetClassName() { return "AITileListBuildableRectangle"; } |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
37 |
|
9669
366771e15a2c
(svn r10608) [NoAI] -Documentation: comment some functions to make Doxygen happy
truelight
parents:
9658
diff
changeset
|
38 |
/** |
366771e15a2c
(svn r10608) [NoAI] -Documentation: comment some functions to make Doxygen happy
truelight
parents:
9658
diff
changeset
|
39 |
* Custom constructor, we want a width and height as parameter. |
366771e15a2c
(svn r10608) [NoAI] -Documentation: comment some functions to make Doxygen happy
truelight
parents:
9658
diff
changeset
|
40 |
*/ |
9657
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
41 |
AITileListBuildableRectangle(uint width, uint height) { this->width = width; this->height = height; } |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
42 |
|
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
43 |
private: |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
44 |
uint width, height; |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
45 |
|
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
46 |
int32 Valuate(int32 tile) const; |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
47 |
}; |
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
48 |
|
f2c6e332d8bc
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents:
9655
diff
changeset
|
49 |
/** |
9611
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
50 |
* Check how tiles in an AITileList instance are sloped. |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
51 |
* @note resulting items are of the type int32 (0 = flat, > 1 = slope) |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
52 |
* @note the input items are of the type TileIndex |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
53 |
*/ |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
54 |
class AITileListSlope : public AIAbstractList::Valuator { |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
55 |
public: |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
56 |
/** |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
57 |
* The name of the class, needed by several sub-processes. |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
58 |
*/ |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
59 |
static const char *GetClassName() { return "AITileListSlope"; } |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
60 |
|
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
61 |
private: |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
62 |
int32 Valuate(int32 tile) const; |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
63 |
}; |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
64 |
|
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
65 |
/** |
9617
df9cedf12aab
(svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents:
9611
diff
changeset
|
66 |
* Count the neighbour tiles which have a piece of road of tiles in AITileList. |
9603
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
67 |
* @note resulting items are of the type int32 (the amount of neighbour road tiles) |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
68 |
* @note the input items are of the type TileIndex |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
69 |
*/ |
9617
df9cedf12aab
(svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents:
9611
diff
changeset
|
70 |
class AITileListNeighbourRoadCount : public AIAbstractList::Valuator { |
9603
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
71 |
public: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
72 |
/** |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
73 |
* The name of the class, needed by several sub-processes. |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
74 |
*/ |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
75 |
static const char *GetClassName() { return "AITileListNeighbourRoad"; } |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
76 |
|
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
77 |
private: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
78 |
int32 Valuate(int32 tile) const; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
79 |
}; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
80 |
|
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
81 |
/** |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
82 |
* Check if the tiles in AITileList have a piece of road on them. |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
83 |
* @note resulting items are of the type bool (0 = no road, 1 = road) |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
84 |
* @note the input items are of the type TileIndex |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
85 |
*/ |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
86 |
class AITileListRoadTile : public AIAbstractList::Valuator { |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
87 |
public: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
88 |
/** |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
89 |
* The name of the class, needed by several sub-processes. |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
90 |
*/ |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
91 |
static const char *GetClassName() { return "AITileListRoadTile"; } |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
92 |
|
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
93 |
private: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
94 |
int32 Valuate(int32 tile) const; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
95 |
}; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
96 |
|
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
97 |
/** |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
98 |
* Get the amount of estimated accepted cargo for all tiles in AITileList. |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
99 |
* If this value is >= 8, it means it will accept this cargo. For passengers |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
100 |
* and mail it is also a good indicator how much cargo would be brought to |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
101 |
* the station. |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
102 |
* @post values < 8 means this tile does not accept this cargo. |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
103 |
* @note resulting items are of the type int32 (indicating acceptance) |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
104 |
* @note the input items are of the type TileIndex |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
105 |
*/ |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
106 |
class AITileListCargoAcceptance : public AIAbstractList::Valuator { |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
107 |
public: |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
108 |
/** |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
109 |
* The name of the class, needed by several sub-processes. |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
110 |
*/ |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
111 |
static const char *GetClassName() { return "AITileListCargoAcceptance"; } |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
112 |
|
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
113 |
/** |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
114 |
* Custom constructor, we want a cargo-type as parameter. |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
115 |
*/ |
9658
e7675771bca4
(svn r10565) [NoAI] -Add: allow giving width, height and radius to check for cargo acceptance
truelight
parents:
9657
diff
changeset
|
116 |
AITileListCargoAcceptance(CargoID cargo_type, uint width, uint height, uint radius) { this->cargo_type = cargo_type; this->width = width; this->height = height; this->radius = radius; } |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
117 |
|
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
118 |
private: |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
119 |
CargoID cargo_type; |
9658
e7675771bca4
(svn r10565) [NoAI] -Add: allow giving width, height and radius to check for cargo acceptance
truelight
parents:
9657
diff
changeset
|
120 |
uint width, height, radius; |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
121 |
|
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
122 |
int32 Valuate(int32 tile) const; |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
123 |
}; |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9603
diff
changeset
|
124 |
|
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
125 |
/** |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
126 |
* Get the manhattan distance to a tile for entries in an AITileList instance. |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
127 |
* @note resulting items are of the type distance |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
128 |
* @note the input items are of the type TileIndex |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
129 |
*/ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
130 |
class AITileListDistanceManhattanToTile : public AIAbstractList::Valuator { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
131 |
public: |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
132 |
/** |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
133 |
* The name of the class, needed by several sub-processes. |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
134 |
*/ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
135 |
static const char *GetClassName() { return "AITileListDistanceManhattanToTile"; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
136 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
137 |
/** |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
138 |
* Custom constructor, we want a tile as parameter. |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
139 |
*/ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
140 |
AITileListDistanceManhattanToTile(TileIndex tile) { this->tile = tile; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
141 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
142 |
private: |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
143 |
TileIndex tile; |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
144 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
145 |
int32 Valuate(int32 station) const; |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
146 |
}; |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
147 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
148 |
/** |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
149 |
* Get the sqsuare distance to a tile for entries in an AITileList instance. |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
150 |
* @note resulting items are of the type distance |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
151 |
* @note the input items are of the type TileIndex |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
152 |
*/ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
153 |
class AITileListDistanceSquareToTile : public AIAbstractList::Valuator { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
154 |
public: |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
155 |
/** |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
156 |
* The name of the class, needed by several sub-processes. |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
157 |
*/ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
158 |
static const char *GetClassName() { return "AITileListDistanceSquareToTile"; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
159 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
160 |
/** |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
161 |
* Custom constructor, we want a tile as parameter. |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
162 |
*/ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
163 |
AITileListDistanceSquareToTile(TileIndex tile) { this->tile = tile; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
164 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
165 |
private: |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
166 |
TileIndex tile; |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
167 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
168 |
int32 Valuate(int32 station) const; |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
169 |
}; |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
170 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9617
diff
changeset
|
171 |
|
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
172 |
#endif /* AI_TILELIST_VALUATOR_HPP */ |