author | truelight |
Sun, 29 Apr 2007 12:35:39 +0000 | |
branch | noai |
changeset 9603 | 49323bf80ebd |
parent 9596 | 8af5a1399842 |
child 9609 | f0dbf5850145 |
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 |
/** |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
27 |
* Check if one of the neighbour tiles in AITileList has a piece of road. |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
28 |
* @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
|
29 |
* @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
|
30 |
*/ |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
31 |
class AITileListNeighbourRoad : public AIAbstractList::Valuator { |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
32 |
public: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
33 |
/** |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
34 |
* 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
|
35 |
*/ |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
36 |
static const char *GetClassName() { return "AITileListNeighbourRoad"; } |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
37 |
|
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
38 |
private: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
39 |
int32 Valuate(int32 tile) const; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
40 |
}; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
41 |
|
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
42 |
/** |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
43 |
* 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
|
44 |
* @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
|
45 |
* @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
|
46 |
*/ |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
47 |
class AITileListRoadTile : public AIAbstractList::Valuator { |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
48 |
public: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
49 |
/** |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
50 |
* 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
|
51 |
*/ |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
52 |
static const char *GetClassName() { return "AITileListRoadTile"; } |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
53 |
|
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
54 |
private: |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
55 |
int32 Valuate(int32 tile) const; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
56 |
}; |
49323bf80ebd
(svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents:
9596
diff
changeset
|
57 |
|
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff
changeset
|
58 |
#endif /* AI_TILELIST_VALUATOR_HPP */ |