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: 00022 static const char *GetClassName() { return "AICompany"; } 00023 00025 enum CompanyID { 00026 COMPANY_FIRST = 0, 00027 COMPANY_LAST = ::MAX_COMPANIES, 00028 COMPANY_SELF = 254, 00029 COMPANY_INVALID = -1, 00030 }; 00031 00033 enum Gender { 00034 GENDER_MALE, 00035 GENDER_FEMALE, 00036 GENDER_INVALID = -1, 00037 }; 00038 00047 static CompanyID ResolveCompanyID(CompanyID company); 00048 00054 static bool IsMine(CompanyID company); 00055 00064 static bool SetName(const char *name); 00065 00072 static char *GetName(CompanyID company); 00073 00081 static bool SetPresidentName(const char *name); 00082 00089 static char *GetPresidentName(CompanyID company); 00090 00098 static bool SetPresidentGender(Gender gender); 00099 00105 static Gender GetPresidentGender(CompanyID company); 00106 00116 static bool SetLoanAmount(int32 loan); 00117 00125 static bool SetMinimumLoanAmount(int32 loan); 00126 00133 static Money GetLoanAmount(); 00134 00141 static Money GetMaxLoanAmount(); 00142 00148 static Money GetLoanInterval(); 00149 00156 static Money GetCompanyValue(CompanyID company); 00157 00164 static Money GetBankBalance(CompanyID company); 00165 00176 static bool BuildCompanyHQ(TileIndex tile); 00177 00185 static TileIndex GetCompanyHQ(CompanyID company); 00186 00192 static bool SetAutoRenewStatus(bool autorenew); 00193 00200 static bool GetAutoRenewStatus(CompanyID company); 00201 00207 static bool SetAutoRenewMonths(int16 months); 00208 00215 static int16 GetAutoRenewMonths(CompanyID company); 00216 00222 static bool SetAutoRenewMoney(uint32 money); 00223 00230 static uint32 GetAutoRenewMoney(CompanyID company); 00231 }; 00232 00233 DECLARE_POSTFIX_INCREMENT(AICompany::CompanyID); 00234 00235 #endif /* AI_COMPANY_HPP */