5 #ifndef AI_COMPANY_HPP |
5 #ifndef AI_COMPANY_HPP |
6 #define AI_COMPANY_HPP |
6 #define AI_COMPANY_HPP |
7 |
7 |
8 #include "ai_object.hpp" |
8 #include "ai_object.hpp" |
9 |
9 |
|
10 /** |
|
11 * Class that handles all company related functions. |
|
12 */ |
10 class AICompany : public AIObject { |
13 class AICompany : public AIObject { |
11 public: |
14 public: |
12 /** |
15 /** |
13 * Set the name of the company |
16 * Set the name of your company. |
14 * @param name the new name of the company |
17 * @param name the new name of the company. |
15 * @pre name != NULL |
18 * @pre name != NULL |
16 * @return true if the command was send without problem |
19 * @return true if the command was send without problem. |
17 */ |
20 */ |
18 bool SetCompanyName(const char *name); |
21 bool SetCompanyName(const char *name); |
19 |
22 |
20 /** |
23 /** |
21 * Get the name of the company |
24 * Get the name of your company. |
22 * @return the name of the company |
25 * @return the name of your company. |
23 * @note the returned company name must be freed |
26 * @note the returned company name must be free'd (C++ only). |
24 */ |
27 */ |
25 char *GetCompanyName(); |
28 char *GetCompanyName(); |
26 |
29 |
27 /** |
30 /** |
28 * Gets the value of the company |
31 * Gets the current value of your company. |
29 * @return the value of the company |
32 * @return the current value of your company. |
30 */ |
33 */ |
31 int32 GetCompanyValue(); |
34 int32 GetCompanyValue(); |
32 |
35 |
33 /** |
36 /** |
34 * Gets the bank balance, i.e. the amount of money that can be spent |
37 * Gets the bank balance. In other words, the amount of money you can spent. |
35 * @return the bank balance of the company |
38 * @return the bank balance of your company. |
36 */ |
39 */ |
37 int32 GetBankBalance(); |
40 int32 GetBankBalance(); |
38 |
41 |
39 /** |
42 /** |
40 * Gets the amount the company have loaned |
43 * Gets the amount your company have loaned. |
41 * @return the amount loaned |
44 * @return the amount loaned money. |
42 * @post return >= 0 |
45 * @post the return value is always positive. |
43 * @post return % this->GetLoanInterval() == 0 |
46 * @post GetLoanInterval() is always a multiplier of the return value. |
44 */ |
47 */ |
45 int32 GetLoanAmount(); |
48 int32 GetLoanAmount(); |
46 |
49 |
47 /** |
50 /** |
48 * Gets the maximum amount the company can loan |
51 * Gets the maximum amount your company can loan. |
49 * @return the maximum amount the company can loan |
52 * @return the maximum amount your company can loan. |
50 * @post return >= 0 |
53 * @post the return value is always positive. |
51 * @post return % this->GetLoanInterval() == 0 |
54 * @post GetLoanInterval() is always a multiplier of the return value. |
52 */ |
55 */ |
53 int32 GetMaxLoanAmount(); |
56 int32 GetMaxLoanAmount(); |
54 |
57 |
55 /** |
58 /** |
56 * Gets the interval/loan steps |
59 * Gets the interval/loan step. |
57 * @return the loan steps |
60 * @return the loan step. |
58 * @post return >= 0 |
61 * @post return value is always positive. |
59 */ |
62 */ |
60 int32 GetLoanInterval(); |
63 int32 GetLoanInterval(); |
61 |
64 |
62 /** |
65 /** |
63 * Sets the amount to loan |
66 * Sets the amount to loan. |
64 * @param loan the amount to load (multitude of GetLoanInterval()) |
67 * @param loan the amount to loan (multiplier of GetLoanInterval()). |
65 * @pre loan >= 0 |
68 * @pre loan must be positive. |
66 * @pre loan % this->GetLoanInterval() == 0 |
69 * @pre GetLoanInterval must be a multiplier of loan. |
67 * @pre loan < GetMaxLoan() |
70 * @pre loan must be below GetMaxLoan(). |
68 * @pre loan - GetLoan() + GetBankBalance() > 0 |
71 * @pre loan - GetLoanAmount() + GetBankBalance() must be positive. |
69 * @return true if the command was send without a problem |
72 * @return true if the loan could be set to your requested amount. |
70 */ |
73 */ |
71 bool SetLoanAmount(int32 loan); |
74 bool SetLoanAmount(int32 loan); |
72 }; |
75 }; |
73 |
76 |
74 #ifdef DEFINE_SQUIRREL_CLASS |
77 #ifdef DEFINE_SQUIRREL_CLASS |