Rearrange conditionals in FreeTrainTrackReservation
[openttd/fttd.git] / src / company_func.h
blob29650d78cd2a7500162f245b7a1b3d2f593d4c09
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file company_func.h Functions related to companies. */
12 #ifndef COMPANY_FUNC_H
13 #define COMPANY_FUNC_H
15 #include "command_type.h"
16 #include "company_type.h"
17 #include "gfx_type.h"
18 #include "vehicle_type.h"
20 bool MayCompanyTakeOver(CompanyID cbig, CompanyID small);
21 void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner);
22 void GetNameOfOwner(Owner owner, TileIndex tile);
23 void SetLocalCompany(CompanyID new_company);
24 void ShowBuyCompanyDialog(CompanyID company);
25 void CompanyAdminUpdate(const Company *company);
26 void CompanyAdminBankrupt(CompanyID company_id);
27 void UpdateLandscapingLimits();
29 bool CheckCompanyHasMoney(CommandCost &cost);
30 void SubtractMoneyFromCompany(CommandCost cost);
31 void SubtractMoneyFromCompanyFract(CompanyID company, CommandCost cost);
32 CommandCost CheckOwnership(Owner owner, TileIndex tile = 0);
33 CommandCost CheckTileOwnership(TileIndex tile);
35 extern CompanyByte _local_company;
36 extern CompanyByte _current_company;
38 extern Colours _company_colours[MAX_COMPANIES];
39 extern CompanyManagerFace _company_manager_face;
41 /**
42 * Is the current company the local company?
43 * @return \c true of the current company is the local company, \c false otherwise.
45 static inline bool IsLocalCompany()
47 return _local_company == _current_company;
50 /**
51 * Is the user representing \a company?
52 * @param company Company where interaction is needed with.
53 * @return Gives \c true if the user can answer questions interactively as representative of \a company, else \c false
55 static inline bool IsInteractiveCompany(CompanyID company)
57 return company == _local_company;
60 int CompanyServiceInterval(const Company *c, VehicleType type);
62 #endif /* COMPANY_FUNC_H */