src/ai/api/ai_townlist_valuator.hpp
author rubidium
Sun, 03 Feb 2008 20:17:54 +0000
branchnoai
changeset 9724 b39bc69bb2f2
parent 9660 d0a430e8310b
child 9753 7209db94ad12
permissions -rw-r--r--
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
     1
/* $Id$ */
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
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_townlist_valuator.hpp all the valuators for townlist */
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
     4
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
     5
#ifndef AI_TOWNLIST_VALUATOR_HPP
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
     6
#define AI_TOWNLIST_VALUATOR_HPP
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
     7
9593
012f29f59906 (svn r9626) [NoAI] -Change: renamed AIList to AIAbstractList and hide 'AddItem' and 'RemoveItem'
truelight
parents: 9589
diff changeset
     8
#include "ai_abstractlist.hpp"
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
     9
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    10
/**
9660
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    11
 * Give a random value for the entries in an AITownList instance.
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    12
 * @note resulting items are of the type int32
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    13
 * @note the input items are of the type TownID
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    14
 */
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    15
class AITownListRandomize : public AIAbstractList::Valuator {
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    16
public:
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    17
	/**
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    18
	 * The name of the class, needed by several sub-processes.
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    19
	 */
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    20
	static const char *GetClassName() { return "AITownListRandomize"; }
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    21
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    22
private:
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    23
	int32 Valuate(int32 town) const;
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    24
};
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    25
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9655
diff changeset
    26
/**
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    27
 * Get the population for entries in an AITownList instance.
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    28
 * @note resulting items are of the type int32
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    29
 * @note the input items are of the type TownID
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    30
 */
9616
ca607e3077dd (svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents: 9596
diff changeset
    31
class AITownListPopulation : public AIAbstractList::Valuator {
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    32
public:
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    33
	/**
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    34
	 * The name of the class, needed by several sub-processes.
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    35
	 */
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    36
	static const char *GetClassName() { return "AITownListGetPopulation"; }
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    37
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    38
private:
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    39
	int32 Valuate(int32 town) const;
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    40
};
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    41
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    42
/**
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    43
 * Get the location for entries in an AITownList instance.
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    44
 * @note resulting items are of the type TileIndex
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    45
 * @note the input items are of the type TownID
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    46
 */
9616
ca607e3077dd (svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents: 9596
diff changeset
    47
class AITownListLocation : public AIAbstractList::Valuator {
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    48
public:
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    49
	/**
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    50
	 * The name of the class, needed by several sub-processes.
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    51
	 */
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    52
	static const char *GetClassName() { return "AITownListGetLocation"; }
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    53
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    54
private:
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    55
	int32 Valuate(int32 town) const;
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    56
};
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
    57
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: 9616
diff changeset
    58
/**
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: 9616
diff changeset
    59
 * Get the manhattan distance to a tile for entries in an AITownList 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: 9616
diff changeset
    60
 * @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: 9616
diff changeset
    61
 * @note the input items are of the type TownID
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: 9616
diff changeset
    62
 */
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: 9616
diff changeset
    63
class AITownListDistanceManhattanToTile : 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: 9616
diff changeset
    64
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: 9616
diff changeset
    65
	/**
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: 9616
diff changeset
    66
	 * 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: 9616
diff changeset
    67
	 */
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: 9616
diff changeset
    68
	static const char *GetClassName() { return "AITownListDistanceManhattanToTile"; }
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: 9616
diff changeset
    69
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: 9616
diff changeset
    70
	/**
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: 9616
diff changeset
    71
	 * 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: 9616
diff changeset
    72
	 */
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: 9616
diff changeset
    73
	AITownListDistanceManhattanToTile(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: 9616
diff changeset
    74
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: 9616
diff changeset
    75
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: 9616
diff changeset
    76
	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: 9616
diff changeset
    77
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: 9616
diff changeset
    78
	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: 9616
diff changeset
    79
};
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: 9616
diff changeset
    80
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: 9616
diff changeset
    81
/**
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: 9616
diff changeset
    82
 * Get the sqsuare distance to a tile for entries in an AITownList 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: 9616
diff changeset
    83
 * @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: 9616
diff changeset
    84
 * @note the input items are of the type TownID
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: 9616
diff changeset
    85
 */
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: 9616
diff changeset
    86
class AITownListDistanceSquareToTile : 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: 9616
diff changeset
    87
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: 9616
diff changeset
    88
	/**
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: 9616
diff changeset
    89
	 * 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: 9616
diff changeset
    90
	 */
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: 9616
diff changeset
    91
	static const char *GetClassName() { return "AITownListDistanceSquareToTile"; }
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: 9616
diff changeset
    92
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: 9616
diff changeset
    93
	/**
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: 9616
diff changeset
    94
	 * 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: 9616
diff changeset
    95
	 */
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: 9616
diff changeset
    96
	AITownListDistanceSquareToTile(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: 9616
diff changeset
    97
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: 9616
diff changeset
    98
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: 9616
diff changeset
    99
	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: 9616
diff changeset
   100
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: 9616
diff changeset
   101
	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: 9616
diff changeset
   102
};
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: 9616
diff changeset
   103
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
diff changeset
   104
#endif /* AI_TOWNLIST_VALUATOR_HPP */