# company_func.h

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