author | truebrain |
Wed, 26 Mar 2008 15:17:40 +0000 | |
branch | noai |
changeset 9823 | 0b7f816cf46f |
parent 9808 | 0b40f556e051 |
child 9829 | 80fbe02a4184 |
permissions | -rw-r--r-- |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
2 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
3 |
/** @file ai_company.hpp Everything to query a company's financials and statistics */ |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
4 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
5 |
#ifndef AI_COMPANY_HPP |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
6 |
#define AI_COMPANY_HPP |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
7 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
8 |
#include "ai_object.hpp" |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
9 |
|
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
10 |
/** |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
11 |
* Class that handles all company related functions. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
12 |
*/ |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
13 |
class AICompany : public AIObject { |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
14 |
public: |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
15 |
/** |
9529
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
16 |
* The name of the class, needed by several sub-processes. |
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
17 |
*/ |
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
18 |
static const char *GetClassName() { return "AICompany"; } |
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
19 |
|
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
20 |
/** Different constants related to companies */ |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
21 |
enum CompanyIndex { |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
22 |
FIRST_COMPANY = 0, ///< The first available company. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
23 |
LAST_COMPANY = 7, ///< The last available company. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
24 |
MY_COMPANY = 8, ///< Constant that gets resolved to the correct company index for your company. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
25 |
INVALID_COMPANY = 9, ///< An invalid company |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
26 |
}; |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
27 |
|
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
28 |
/** |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
29 |
* Resolved the given company index to the correct index |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
30 |
* for the company. If the company index was MY_COMPANY |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
31 |
* it will be resolved to the index of your company. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
32 |
* If the company with the given index does not exist |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
33 |
* it will return INVALID_COMPANY. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
34 |
* @param company the company index to resolve. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
35 |
* @return the resolved company index. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
36 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
37 |
static CompanyIndex ResolveCompanyIndex(CompanyIndex company); |
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
38 |
|
9529
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
39 |
/** |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
40 |
* Set the name of your company. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
41 |
* @param name the new name of the company. |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
42 |
* @pre name != NULL |
9575
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
43 |
* @return true if the name was changed. |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
44 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
45 |
static bool SetCompanyName(const char *name); |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
46 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
47 |
/** |
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
48 |
* Get the name of the given company. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
49 |
* @param company the company to get the name for. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
50 |
* @pre ResolveCompanyIndex(company) != INVALID_COMPANY |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
51 |
* @return the name of the given company. |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
52 |
* @note the returned company name must be free'd (C++ only). |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
53 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
54 |
static char *GetCompanyName(CompanyIndex company); |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
55 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
56 |
/** |
9575
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
57 |
* Set the name of your president. |
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
58 |
* @param name the new name of the president. |
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
59 |
* @pre name != NULL |
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
60 |
* @return true if the name was changed. |
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
61 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
62 |
static bool SetPresidentName(const char *name); |
9575
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
63 |
|
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
64 |
/** |
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
65 |
* Get the name of the president of the given company. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
66 |
* @param company the company to get the president's name for. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
67 |
* @pre ResolveCompanyIndex(company) != INVALID_COMPANY |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
68 |
* @return the name of the president of the given company. |
9575
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
69 |
* @note the returned president name must be free'd (C++ only). |
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
70 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
71 |
static char *GetPresidentName(CompanyIndex company); |
9575
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
72 |
|
a4b6bbfa6c96
(svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents:
9541
diff
changeset
|
73 |
/** |
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
74 |
* Gets the current value of the given company. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
75 |
* @param company the company to get the company value of. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
76 |
* @pre ResolveCompanyIndex(company) != INVALID_COMPANY |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
77 |
* @return the current value of the given company. |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
78 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
79 |
static int32 GetCompanyValue(CompanyIndex company); |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
80 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
81 |
/** |
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
82 |
* Gets the bank balance. In other words, the amount of money the given company can spent. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
83 |
* @param company the company to get the bank balance of. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
84 |
* @pre ResolveCompanyIndex(company) != INVALID_COMPANY |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
85 |
* @return the actual bank balance. |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
86 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
87 |
static int32 GetBankBalance(CompanyIndex company); |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
88 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
89 |
/** |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
90 |
* Gets the amount your company have loaned. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
91 |
* @return the amount loaned money. |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9447
diff
changeset
|
92 |
* @post the return value is always non-negative. |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
93 |
* @post GetLoanInterval() is always a multiplier of the return value. |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
94 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
95 |
static int32 GetLoanAmount(); |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
96 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
97 |
/** |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
98 |
* Gets the maximum amount your company can loan. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
99 |
* @return the maximum amount your company can loan. |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9447
diff
changeset
|
100 |
* @post the return value is always non-negative. |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
101 |
* @post GetLoanInterval() is always a multiplier of the return value. |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
102 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
103 |
static int32 GetMaxLoanAmount(); |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
104 |
|
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
105 |
/** |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
106 |
* Gets the interval/loan step. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
107 |
* @return the loan step. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
108 |
* @post return value is always positive. |
9376
7c12a15c945a
(svn r9164) [NoAI] -Add: function to get the value of LOAN_INTERVAL in the AIs.
rubidium
parents:
9374
diff
changeset
|
109 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
110 |
static int32 GetLoanInterval(); |
9376
7c12a15c945a
(svn r9164) [NoAI] -Add: function to get the value of LOAN_INTERVAL in the AIs.
rubidium
parents:
9374
diff
changeset
|
111 |
|
7c12a15c945a
(svn r9164) [NoAI] -Add: function to get the value of LOAN_INTERVAL in the AIs.
rubidium
parents:
9374
diff
changeset
|
112 |
/** |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
113 |
* Sets the amount to loan. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
114 |
* @param loan the amount to loan (multiplier of GetLoanInterval()). |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9447
diff
changeset
|
115 |
* @pre loan must be non-negative. |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
116 |
* @pre GetLoanInterval must be a multiplier of loan. |
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
117 |
* @pre loan must be below GetMaxLoan(). |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9447
diff
changeset
|
118 |
* @pre loan - GetLoanAmount() + GetBankBalance() must be non-negative. |
9447
8f3c1bc72204
(svn r9272) [NoAI] -Documentation: made the documentation of the first 3 API files more readable for non-programmers
truelight
parents:
9427
diff
changeset
|
119 |
* @return true if the loan could be set to your requested amount. |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
120 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
121 |
static bool SetLoanAmount(int32 loan); |
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
122 |
|
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
123 |
/** |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
124 |
* Sets the minimum amount to loan, i.e. the given amount of loan rounded up. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
125 |
* @param loan the amount to loan (any positive number). |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
126 |
* @pre loan must be non-negative. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
127 |
* @pre loan must be below GetMaxLoan(). |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
128 |
* @return true if we could allocate a minimum of "loan" loan. |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
129 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9668
diff
changeset
|
130 |
static bool SetMinimumLoanAmount(int32 loan); |
9808
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
131 |
|
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
132 |
/** |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
133 |
* Build your company's HQ on the given tile. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
134 |
* @param tile the tile to build your HQ on, this tile is the most nothern tile of your HQ. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
135 |
* @pre AIMap::IsValidTile(tile). |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
136 |
* @note An HQ can not be removed, only by water or rebuilding; If an HQ is build again, the old one is removed. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
137 |
* @return true if the HQ could be build. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
138 |
*/ |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
139 |
static bool BuildCompanyHQ(TileIndex tile); |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
140 |
|
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
141 |
/** |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
142 |
* Return the location of a company's HQ. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
143 |
* @param company the company the get the HQ of. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
144 |
* @pre ResolveCompanyIndex(company) != INVALID_COMPANY. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
145 |
* @return The tile of the company's HQ, this tile is the most nothern tile of that HQ, or INVALID_TILE if there is no HQ yet. |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
146 |
*/ |
0b40f556e051
(svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents:
9737
diff
changeset
|
147 |
static TileIndex GetCompanyHQ(CompanyIndex company); |
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
148 |
}; |
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
149 |
|
9668
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
150 |
DECLARE_POSTFIX_INCREMENT(AICompany::CompanyIndex); |
6fe3d2cb9655
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents:
9596
diff
changeset
|
151 |
|
9374
61379e9b2393
(svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff
changeset
|
152 |
#endif /* AI_COMPANY_HPP */ |