src/ai/api/ai_company.hpp
author truebrain
Mon, 31 Mar 2008 07:21:39 +0000
branchnoai
changeset 9835 2541c2d325ed
parent 9829 80fbe02a4184
child 9853 b0512cb3ceb1
permissions -rw-r--r--
(svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
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
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
     3
/** @file ai_company.hpp Everything to query a company's financials and statistics or build company related buildings. */
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
     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:
9529
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    15
	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
    16
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    17
	/** Different constants related to CompanyIndex. */
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
    18
	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
    19
		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
    20
		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
    21
		MY_COMPANY      = 8, ///< Constant that gets resolved to the correct company index for your company.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    22
		INVALID_COMPANY = 9, ///< An invalid 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
    23
	};
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
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
	/**
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    26
	 * Resolved the given company index to the correct index for the company. If
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    27
	 *  the company index was MY_COMPANY it will be resolved to the index of
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    28
	 *  your company. If the company with the given index does not exist it will
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    29
	 *  return INVALID_COMPANY.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    30
	 * @param company The company index to resolve.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    31
	 * @return The resolved company index.
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
    32
	 */
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
    33
	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
    34
9529
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    35
	/**
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
    36
	 * Set the name of your company.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    37
	 * @param name The new name of the company.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    38
	 * @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
    39
	 */
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
    40
	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
    41
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
	/**
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
    43
	 * Get the name of the given company.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    44
	 * @param company The company to get the name for.
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
    45
	 * @pre ResolveCompanyIndex(company) != INVALID_COMPANY
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    46
	 * @return The name 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
    47
	 */
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
    48
	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
    49
61379e9b2393 (svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff changeset
    50
	/**
9575
a4b6bbfa6c96 (svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents: 9541
diff changeset
    51
	 * Set the name of your president.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    52
	 * @param name The new name of the president.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    53
	 * @return True if the name was changed.
9575
a4b6bbfa6c96 (svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents: 9541
diff changeset
    54
	 */
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
    55
	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
    56
a4b6bbfa6c96 (svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents: 9541
diff changeset
    57
	/**
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
    58
	 * Get the name of the president of the given company.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    59
	 * @param company The company to get the president's name for.
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
    60
	 * @pre ResolveCompanyIndex(company) != INVALID_COMPANY
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    61
	 * @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
    62
	 */
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
    63
	static char *GetPresidentName(CompanyIndex company);
9575
a4b6bbfa6c96 (svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents: 9541
diff changeset
    64
a4b6bbfa6c96 (svn r9591) [NoAI] -Fix: SetCompanyName() in fact set the president name (Zuu)
truelight
parents: 9541
diff changeset
    65
	/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    66
	 * Sets the amount to loan.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    67
	 * @param loan The amount to loan (multiplier of GetLoanInterval()).
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    68
	 * @pre 'loan' must be non-negative.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    69
	 * @pre GetLoanInterval() must be a multiplier of GetLoanInterval().
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    70
	 * @pre 'loan' must be below GetMaxLoanAmount().
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    71
	 * @pre 'loan' - GetLoanAmount() + GetBankBalance() must be non-negative.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    72
	 * @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
    73
	 */
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    74
	static bool SetLoanAmount(int32 loan);
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
    75
61379e9b2393 (svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff changeset
    76
	/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    77
	 * Sets the minimum amount to loan, i.e. the given amount of loan rounded up.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    78
	 * @param loan The amount to loan (any positive number).
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    79
	 * @pre 'loan' must be non-negative.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    80
	 * @pre 'loan' must be below GetMaxLoanAmount().
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    81
	 * @return True if we could allocate a minimum of "loan" loan.
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
    82
	 */
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    83
	static bool SetMinimumLoanAmount(int32 loan);
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
    84
61379e9b2393 (svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff changeset
    85
	/**
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
    86
	 * Gets the amount your company have loaned.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    87
	 * @return The amount loaned money.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    88
	 * @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
    89
	 * @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
    90
	 */
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
    91
	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
    92
61379e9b2393 (svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff changeset
    93
	/**
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
    94
	 * Gets the maximum amount your company can loan.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    95
	 * @return The maximum amount your company can loan.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
    96
	 * @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
    97
	 * @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
    98
	 */
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
    99
	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
   100
61379e9b2393 (svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff changeset
   101
	/**
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
   102
	 * Gets the interval/loan step.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   103
	 * @return The loan step.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   104
	 * @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
   105
	 */
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
   106
	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
   107
7c12a15c945a (svn r9164) [NoAI] -Add: function to get the value of LOAN_INTERVAL in the AIs.
rubidium
parents: 9374
diff changeset
   108
	/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
   109
	 * Gets the current value of the given company.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   110
	 * @param company The company to get the company value of.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
   111
	 * @pre ResolveCompanyIndex(company) != INVALID_COMPANY
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   112
	 * @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
   113
	 */
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
   114
	static int32 GetCompanyValue(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
   115
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
   116
	/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
   117
	 * Gets the bank balance. In other words, the amount of money the given company can spent.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   118
	 * @param company The company to get the bank balance of.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
   119
	 * @pre ResolveCompanyIndex(company) != INVALID_COMPANY
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   120
	 * @return The actual bank balance.
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
   121
	 */
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
   122
	static int32 GetBankBalance(CompanyIndex company);
9808
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   123
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   124
	/**
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   125
	 * Build your company's HQ on the given tile.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   126
	 * @param tile The tile to build your HQ on, this tile is the most nothern tile of your HQ.
9808
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   127
	 * @pre AIMap::IsValidTile(tile).
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   128
	 * @return True if the HQ could be build.
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   129
	 * @note An HQ can not be removed, only by water or rebuilding; If an HQ is
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   130
	 *  build again, the old one is removed.
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
	static bool BuildCompanyHQ(TileIndex tile);
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   133
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   134
	/**
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   135
	 * Return the location of a company's HQ.
9835
2541c2d325ed (svn r12500) [NoAI] -Documentation: many comment changes, mostly Capitals and lines end with a dot. Makes doxygen look pretty :)
truebrain
parents: 9829
diff changeset
   136
	 * @param company The company the get the HQ of.
9808
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   137
	 * @pre ResolveCompanyIndex(company) != INVALID_COMPANY.
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   138
	 * @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
   139
	 */
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9737
diff changeset
   140
	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
   141
};
61379e9b2393 (svn r9161) [NoAI] -Add: functions to get/set company related information: loan, bank balance, company value and company name.
rubidium
parents:
diff changeset
   142
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
   143
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
   144
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
   145
#endif /* AI_COMPANY_HPP */