2008-01-12 14:10:35 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
/** @file company_func.h Functions related to companies. */
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
#ifndef COMPANY_FUNC_H
|
|
|
|
#define COMPANY_FUNC_H
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-09-30 20:51:04 +00:00
|
|
|
#include "company_type.h"
|
2008-01-12 14:10:35 +00:00
|
|
|
#include "tile_type.h"
|
2009-02-09 01:06:23 +00:00
|
|
|
#include "gfx_type.h"
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2010-08-06 20:26:01 +00:00
|
|
|
bool MayCompanyTakeOver(CompanyID cbig, CompanyID small);
|
2008-09-30 20:39:50 +00:00
|
|
|
void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner);
|
2008-01-12 14:10:35 +00:00
|
|
|
void GetNameOfOwner(Owner owner, TileIndex tile);
|
2008-09-30 20:39:50 +00:00
|
|
|
void SetLocalCompany(CompanyID new_company);
|
2009-09-01 12:57:04 +00:00
|
|
|
void ShowBuyCompanyDialog(CompanyID company);
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
extern CompanyByte _local_company;
|
|
|
|
extern CompanyByte _current_company;
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2010-08-01 17:45:53 +00:00
|
|
|
extern Colours _company_colours[MAX_COMPANIES];
|
|
|
|
extern CompanyManagerFace _company_manager_face;
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2010-07-31 21:43:07 +00:00
|
|
|
/**
|
|
|
|
* Is the current company the local company?
|
|
|
|
* @return \c true of the current company is the local company, \c false otherwise.
|
|
|
|
*/
|
2008-09-30 20:39:50 +00:00
|
|
|
static inline bool IsLocalCompany()
|
2008-01-12 14:10:35 +00:00
|
|
|
{
|
2008-09-30 20:39:50 +00:00
|
|
|
return _local_company == _current_company;
|
2008-01-12 14:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-08-01 17:45:53 +00:00
|
|
|
/**
|
|
|
|
* Is the user representing \a company?
|
|
|
|
* @param company Company where interaction is needed with.
|
|
|
|
* @return Gives \c true if the user can answer questions interactively as representative of \a company, else \c false
|
|
|
|
*/
|
2008-09-30 20:39:50 +00:00
|
|
|
static inline bool IsInteractiveCompany(CompanyID company)
|
2008-01-12 14:10:35 +00:00
|
|
|
{
|
2008-09-30 20:39:50 +00:00
|
|
|
return company == _local_company;
|
2008-01-12 14:10:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
#endif /* COMPANY_FUNC_H */
|