script_company.hpp

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
00008  */
00009 
00012 #ifndef SCRIPT_COMPANY_HPP
00013 #define SCRIPT_COMPANY_HPP
00014 
00015 #include "script_object.hpp"
00016 
00021 class ScriptCompany : public ScriptObject {
00022 public:
00024   enum Quarter {
00025     CURRENT_QUARTER = 0,                     
00026     EARLIEST_QUARTER = MAX_HISTORY_QUARTERS, 
00027   };
00028 
00030   enum CompanyID {
00031     COMPANY_FIRST   = 0,               
00032     COMPANY_LAST    = ::MAX_COMPANIES, 
00033     COMPANY_SELF    = 254,             
00034     COMPANY_INVALID = -1,              
00035   };
00036 
00038   enum Gender {
00039     GENDER_MALE,         
00040     GENDER_FEMALE,       
00041     GENDER_INVALID = -1, 
00042   };
00043 
00052   static CompanyID ResolveCompanyID(CompanyID company);
00053 
00059   static bool IsMine(CompanyID company);
00060 
00069   static bool SetName(const char *name);
00070 
00077   static char *GetName(CompanyID company);
00078 
00086   static bool SetPresidentName(const char *name);
00087 
00094   static char *GetPresidentName(CompanyID company);
00095 
00103   static bool SetPresidentGender(Gender gender);
00104 
00110   static Gender GetPresidentGender(CompanyID company);
00111 
00121   static bool SetLoanAmount(int32 loan);
00122 
00130   static bool SetMinimumLoanAmount(int32 loan);
00131 
00137   static Money GetLoanAmount();
00138 
00144   static Money GetMaxLoanAmount();
00145 
00151   static Money GetLoanInterval();
00152 
00159   static Money GetBankBalance(CompanyID company);
00160 
00169   static Money GetQuarterlyIncome(CompanyID company, uint32 quarter);
00170 
00179   static Money GetQuarterlyExpenses(CompanyID company, uint32 quarter);
00180 
00189   static int32 GetQuarterlyCargoDelivered(CompanyID company, uint32 quarter);
00190 
00201   static int32 GetQuarterlyPerformanceRating(CompanyID company, uint32 quarter);
00202 
00211   static Money GetQuarterlyCompanyValue(CompanyID company, uint32 quarter);
00212 
00223   static bool BuildCompanyHQ(TileIndex tile);
00224 
00232   static TileIndex GetCompanyHQ(CompanyID company);
00233 
00239   static bool SetAutoRenewStatus(bool autorenew);
00240 
00247   static bool GetAutoRenewStatus(CompanyID company);
00248 
00254   static bool SetAutoRenewMonths(int16 months);
00255 
00262   static int16 GetAutoRenewMonths(CompanyID company);
00263 
00269   static bool SetAutoRenewMoney(uint32 money);
00270 
00277   static uint32 GetAutoRenewMoney(CompanyID company);
00278 };
00279 
00280 DECLARE_POSTFIX_INCREMENT(ScriptCompany::CompanyID)
00281 
00282 #endif /* SCRIPT_COMPANY_HPP */