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 AI_COMPANY_HPP 00013 #define AI_COMPANY_HPP 00014 00015 #include "ai_object.hpp" 00016 00020 class AICompany : public AIObject { 00021 public: 00023 static const char *GetClassName() { return "AICompany"; } 00024 00026 enum CompanyID { 00027 COMPANY_FIRST = 0, 00028 COMPANY_LAST = ::MAX_COMPANIES, 00029 COMPANY_SELF = 254, 00030 COMPANY_INVALID = -1, 00031 }; 00032 00034 enum Gender { 00035 GENDER_MALE, 00036 GENDER_FEMALE, 00037 GENDER_INVALID = -1, 00038 }; 00039 00048 static CompanyID ResolveCompanyID(CompanyID company); 00049 00055 static bool IsMine(CompanyID company); 00056 00065 static bool SetName(const char *name); 00066 00073 static char *GetName(CompanyID company); 00074 00082 static bool SetPresidentName(const char *name); 00083 00090 static char *GetPresidentName(CompanyID company); 00091 00099 static bool SetPresidentGender(Gender gender); 00100 00106 static Gender GetPresidentGender(CompanyID company); 00107 00117 static bool SetLoanAmount(int32 loan); 00118 00126 static bool SetMinimumLoanAmount(int32 loan); 00127 00134 static Money GetLoanAmount(); 00135 00142 static Money GetMaxLoanAmount(); 00143 00149 static Money GetLoanInterval(); 00150 00157 static Money GetCompanyValue(CompanyID company); 00158 00165 static Money GetBankBalance(CompanyID company); 00166 00177 static bool BuildCompanyHQ(TileIndex tile); 00178 00186 static TileIndex GetCompanyHQ(CompanyID company); 00187 00193 static bool SetAutoRenewStatus(bool autorenew); 00194 00201 static bool GetAutoRenewStatus(CompanyID company); 00202 00208 static bool SetAutoRenewMonths(int16 months); 00209 00216 static int16 GetAutoRenewMonths(CompanyID company); 00217 00223 static bool SetAutoRenewMoney(uint32 money); 00224 00231 static uint32 GetAutoRenewMoney(CompanyID company); 00232 }; 00233 00234 DECLARE_POSTFIX_INCREMENT(AICompany::CompanyID) 00235 00236 #endif /* AI_COMPANY_HPP */