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 COMPANY_FUNC_H 00013 #define COMPANY_FUNC_H 00014 00015 #include "command_type.h" 00016 #include "company_type.h" 00017 #include "gfx_type.h" 00018 00019 bool MayCompanyTakeOver(CompanyID cbig, CompanyID small); 00020 void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner); 00021 void GetNameOfOwner(Owner owner, TileIndex tile); 00022 void SetLocalCompany(CompanyID new_company); 00023 void ShowBuyCompanyDialog(CompanyID company); 00024 void CompanyAdminUpdate(const Company *company); 00025 void CompanyAdminBankrupt(CompanyID company_id); 00026 void UpdateLandscapingLimits(); 00027 00028 bool CheckCompanyHasMoney(CommandCost &cost); 00029 void SubtractMoneyFromCompany(CommandCost cost); 00030 void SubtractMoneyFromCompanyFract(CompanyID company, CommandCost cost); 00031 CommandCost CheckOwnership(Owner owner, TileIndex tile = 0); 00032 CommandCost CheckTileOwnership(TileIndex tile); 00033 00034 extern CompanyByte _local_company; 00035 extern CompanyByte _current_company; 00036 00037 extern Colours _company_colours[MAX_COMPANIES]; 00038 extern CompanyManagerFace _company_manager_face; 00039 00044 static inline bool IsLocalCompany() 00045 { 00046 return _local_company == _current_company; 00047 } 00048 00054 static inline bool IsInteractiveCompany(CompanyID company) 00055 { 00056 return company == _local_company; 00057 } 00058 00059 #endif /* COMPANY_FUNC_H */