author | truebrain |
Thu, 28 Feb 2008 01:11:23 +0000 | |
branch | noai |
changeset 9803 | c86d5834fb11 |
parent 9788 | e9dbd4ec1784 |
permissions | -rw-r--r-- |
9788
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
1 |
/** @file ai_cargolist_valuator.hpp all the valuators for AICargoList */ |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
2 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
3 |
#ifndef AI_CARGOLIST_VALUATOR_HPP |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
4 |
#define AI_CARGOLIST_VALUATOR_HPP |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
5 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
6 |
#include "ai_abstractlist.hpp" |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
7 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
8 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
9 |
/** |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
10 |
* Checks if the given cargo is freight cargo, for all entries in an AICargoList. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
11 |
* @note Resulting items are of the type uint32. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
12 |
* @note Can only operate on a AICargoList. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
13 |
* @ingroup AICargoList. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
14 |
*/ |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
15 |
class AICargoList_vIsFreight : public AIAbstractList::Valuator { |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
16 |
public: |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
17 |
static const char *GetClassName() { return "AICargoList_vIsFreight"; } |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
18 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
19 |
private: |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
20 |
const char *GetListName() const { return "AICargoList"; } |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
21 |
int32 Valuate(int32 cargo) const; |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
22 |
}; |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
23 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
24 |
/** |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
25 |
* Get the income for transporting one unit of cargo over the given distance |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
26 |
* within the specified time. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
27 |
* @note Resulting items are of the type uint32. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
28 |
* @note Can only operate on a AICargoList. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
29 |
* @ingroup AICargoList. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
30 |
*/ |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
31 |
class AICargoList_vCargoIncomes : public AIAbstractList::Valuator { |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
32 |
public: |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
33 |
static const char *GetClassName() { return "AICargoList_vCargoIncomes"; } |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
34 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
35 |
/** |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
36 |
* @param distance The distance the cargo travels from begin to end. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
37 |
* @param days_in_transit Amount of (game)days the cargo is in transit. |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
38 |
*/ |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
39 |
AICargoList_vCargoIncomes(uint32 distance, uint32 days_in_transit) : |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
40 |
distance(distance), |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
41 |
days_in_transit(days_in_transit) |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
42 |
{} |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
43 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
44 |
private: |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
45 |
uint32 distance, days_in_transit; |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
46 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
47 |
const char *GetListName() const { return "AICargoList"; } |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
48 |
int32 Valuate(int32 cargo) const; |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
49 |
}; |
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
50 |
|
e9dbd4ec1784
(svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents:
diff
changeset
|
51 |
#endif // AI_CARGOLIST_VALUATOR_HPP |