src/ai/api/ai_tilelist_valuator.hpp
author truelight
Sat, 14 Jul 2007 21:15:49 +0000
branchnoai
changeset 9657 f2c6e332d8bc
parent 9655 e8e43f333832
child 9658 e7675771bca4
permissions -rw-r--r--
(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
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
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
    38
	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
    39
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
    40
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
    41
	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
    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
	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
    44
};
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
/**
9611
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
    47
 * 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
    48
 * @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
    49
 * @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
    50
 */
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
    51
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
    52
public:
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
	 * 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
    55
	 */
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
    56
	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
    57
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
    58
private:
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
    59
	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
    60
};
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
    61
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
    62
/**
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
    63
 * 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
    64
 * @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
    65
 * @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
    66
 */
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
    67
class AITileListNeighbourRoadCount : public AIAbstractList::Valuator {
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    68
public:
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    69
	/**
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    70
	 * 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
    71
	 */
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    72
	static const char *GetClassName() { return "AITileListNeighbourRoad"; }
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    73
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    74
private:
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    75
	int32 Valuate(int32 tile) const;
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
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    78
/**
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    79
 * 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
    80
 * @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
    81
 * @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
    82
 */
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    83
class AITileListRoadTile : public AIAbstractList::Valuator {
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    84
public:
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
	 * 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
    87
	 */
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    88
	static const char *GetClassName() { return "AITileListRoadTile"; }
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    89
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    90
private:
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    91
	int32 Valuate(int32 tile) const;
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
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
    94
/**
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
    95
 * 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
    96
 * 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
    97
 *  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
    98
 *  the station.
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
    99
 * @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
   100
 * @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
   101
 * @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
   102
 */
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   103
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
   104
public:
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
	 * 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
   107
	 */
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   108
	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
   109
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
	 * 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
   112
	 */
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   113
	AITileListCargoAcceptance(CargoID cargo_type) { this->cargo_type = cargo_type; }
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   114
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   115
private:
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   116
	CargoID cargo_type;
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
	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
   119
};
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   120
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
   121
/**
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
   122
 * 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
   123
 * @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
   124
 * @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
   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
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
   127
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
   128
	/**
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
	 * 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
   130
	 */
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
	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
   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
	/**
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
	 * 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
   135
	 */
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
	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
   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
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
   139
	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
   140
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
	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
   142
};
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
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
 * 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
   146
 * @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
   147
 * @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
   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
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
   150
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
   151
	/**
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
	 * 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
   153
	 */
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
	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
   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
	/**
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
	 * 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
   158
	 */
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
	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
   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
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
   162
	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
   163
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
	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
   165
};
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
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
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
diff changeset
   168
#endif /* AI_TILELIST_VALUATOR_HPP */