Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef SCRIPT_COMPANY_HPP
00013 #define SCRIPT_COMPANY_HPP
00014
00015 #include "script_object.hpp"
00016 #include "script_text.hpp"
00017
00022 class ScriptCompany : public ScriptObject {
00023 public:
00025 enum Quarter {
00026 CURRENT_QUARTER = 0,
00027 EARLIEST_QUARTER = ::MAX_HISTORY_QUARTERS,
00028 };
00029
00031 enum CompanyID {
00032
00033 COMPANY_FIRST = ::COMPANY_FIRST,
00034 COMPANY_LAST = ::MAX_COMPANIES,
00035
00036
00037 COMPANY_INVALID = -1,
00038 COMPANY_SELF = 254,
00039 };
00040
00042 enum Gender {
00043 GENDER_MALE,
00044 GENDER_FEMALE,
00045 GENDER_INVALID = -1,
00046 };
00047
00056 static CompanyID ResolveCompanyID(CompanyID company);
00057
00064 static bool IsMine(CompanyID company);
00065
00073 static bool SetName(Text *name);
00074
00081 static char *GetName(CompanyID company);
00082
00090 static bool SetPresidentName(Text *name);
00091
00098 static char *GetPresidentName(CompanyID company);
00099
00108 static bool SetPresidentGender(Gender gender);
00109
00115 static Gender GetPresidentGender(CompanyID company);
00116
00127 static bool SetLoanAmount(int32 loan);
00128
00137 static bool SetMinimumLoanAmount(int32 loan);
00138
00144 static Money GetLoanAmount();
00145
00151 static Money GetMaxLoanAmount();
00152
00158 static Money GetLoanInterval();
00159
00166 static Money GetBankBalance(CompanyID company);
00167
00176 static Money GetQuarterlyIncome(CompanyID company, uint32 quarter);
00177
00186 static Money GetQuarterlyExpenses(CompanyID company, uint32 quarter);
00187
00196 static int32 GetQuarterlyCargoDelivered(CompanyID company, uint32 quarter);
00197
00208 static int32 GetQuarterlyPerformanceRating(CompanyID company, uint32 quarter);
00209
00218 static Money GetQuarterlyCompanyValue(CompanyID company, uint32 quarter);
00219
00231 static bool BuildCompanyHQ(TileIndex tile);
00232
00240 static TileIndex GetCompanyHQ(CompanyID company);
00241
00248 static bool SetAutoRenewStatus(bool autorenew);
00249
00256 static bool GetAutoRenewStatus(CompanyID company);
00257
00264 static bool SetAutoRenewMonths(int16 months);
00265
00272 static int16 GetAutoRenewMonths(CompanyID company);
00273
00280 static bool SetAutoRenewMoney(uint32 money);
00281
00288 static uint32 GetAutoRenewMoney(CompanyID company);
00289 };
00290
00291 DECLARE_POSTFIX_INCREMENT(ScriptCompany::CompanyID)
00292
00293 #endif