2006-09-16 22:07:38 +01:00
|
|
|
/* $Id$ */
|
2006-03-31 09:59:19 +01:00
|
|
|
|
2009-08-21 21:21:05 +01: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-05-06 16:11:33 +01:00
|
|
|
/** @file unmovable.h Functions related to unmovable objects. */
|
2007-04-04 05:08:47 +01:00
|
|
|
|
2006-03-31 09:59:19 +01:00
|
|
|
#ifndef UNMOVABLE_H
|
|
|
|
#define UNMOVABLE_H
|
|
|
|
|
2009-02-05 03:41:42 +00:00
|
|
|
#include "economy_func.h"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "strings_type.h"
|
2010-08-02 22:35:59 +01:00
|
|
|
#include "unmovable_type.h"
|
2009-02-05 03:41:42 +00:00
|
|
|
|
2008-09-30 21:39:50 +01:00
|
|
|
void UpdateCompanyHQ(Company *c, uint score);
|
2006-03-31 09:59:19 +01:00
|
|
|
|
2010-08-02 21:12:02 +01:00
|
|
|
/** An (unmovable) object that isn't use for transport, industries or houses. */
|
2009-02-05 03:41:42 +00:00
|
|
|
struct UnmovableSpec {
|
2010-08-02 21:12:02 +01:00
|
|
|
StringID name; ///< The name for this object.
|
|
|
|
uint8 build_cost_multiplier; ///< Build cost multiplier per tile.
|
|
|
|
uint8 clear_cost_multiplier; ///< Clear cost multiplier per tile.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the cost for building a structure of this type.
|
|
|
|
* @return The cost for building.
|
|
|
|
*/
|
|
|
|
Money GetBuildCost() const { return (_price[PR_BUILD_UNMOVABLE] * this->build_cost_multiplier); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the cost for clearing a structure of this type.
|
|
|
|
* @return The cost for clearing.
|
|
|
|
*/
|
|
|
|
Money GetClearCost() const { return (_price[PR_CLEAR_UNMOVABLE] * this->clear_cost_multiplier); }
|
2010-08-02 21:57:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the specification associated with a specific UnmovableType.
|
|
|
|
* @param index The unmovable type to fetch.
|
|
|
|
* @return The specification.
|
|
|
|
*/
|
2010-08-02 22:35:59 +01:00
|
|
|
static const UnmovableSpec *Get(UnmovableType index);
|
2010-08-02 21:57:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the specification associated with a tile.
|
|
|
|
* @param tile The tile to fetch the data for.
|
|
|
|
* @return The specification.
|
|
|
|
*/
|
|
|
|
static const UnmovableSpec *GetByTile(TileIndex tile);
|
2009-02-05 03:41:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-09-28 19:42:35 +01:00
|
|
|
#endif /* UNMOVABLE_H */
|