Files
@ r15711:3aee22562e83
Branch filter:
Location: cpp/openttd-patchpack/source/src/unmovable.h - annotation
r15711:3aee22562e83
4.2 KiB
text/x-c
(svn r20388) -Update from WebTranslator v3.0:
belarusian - 216 changes by KorneySan, Wowanxm
croatian - 5 changes by VoyagerOne
dutch - 5 changes by Yexo
hungarian - 7 changes by IPG
italian - 5 changes by lorenzodv
korean - 5 changes by junho2813
polish - 5 changes by lion
portuguese - 10 changes by SupSuper
romanian - 11 changes by tonny
russian - 9 changes by KorneySan
spanish - 5 changes by Terkhen
swedish - 9 changes by tool
vietnamese - 4 changes by nglekhoi
belarusian - 216 changes by KorneySan, Wowanxm
croatian - 5 changes by VoyagerOne
dutch - 5 changes by Yexo
hungarian - 7 changes by IPG
italian - 5 changes by lorenzodv
korean - 5 changes by junho2813
polish - 5 changes by lion
portuguese - 10 changes by SupSuper
romanian - 11 changes by tonny
russian - 9 changes by KorneySan
spanish - 5 changes by Terkhen
swedish - 9 changes by tool
vietnamese - 4 changes by nglekhoi
r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r9111:983de9c5a848 r6423:c3b8b9853091 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r11010:14865490174c r14248:a9050881acd7 r15651:d546d3d294b1 r11010:14865490174c r15662:a307b73248ed r15662:a307b73248ed r15666:877f487d9446 r15662:a307b73248ed r15662:a307b73248ed r15666:877f487d9446 r5475:3f5cd13d1b63 r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15662:a307b73248ed r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15665:8a1a5d5b328a r15641:6f7f469df319 r11010:14865490174c r15641:6f7f469df319 r15661:2519efb1813e r15641:6f7f469df319 r15641:6f7f469df319 r15665:8a1a5d5b328a r11010:14865490174c r15641:6f7f469df319 r15641:6f7f469df319 r15641:6f7f469df319 r15641:6f7f469df319 r15641:6f7f469df319 r11010:14865490174c r15641:6f7f469df319 r15641:6f7f469df319 r15641:6f7f469df319 r15641:6f7f469df319 r15641:6f7f469df319 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15651:d546d3d294b1 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r15646:39c2d02e9307 r11010:14865490174c r11010:14865490174c r11010:14865490174c r5475:3f5cd13d1b63 | /* $Id$ */
/*
* 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/>.
*/
/** @file unmovable.h Functions related to unmovable objects. */
#ifndef UNMOVABLE_H
#define UNMOVABLE_H
#include "economy_func.h"
#include "strings_type.h"
#include "unmovable_type.h"
/**
* Update the CompanyHQ to the state associated with the given score
* @param tile The (northern) tile of the company HQ, or INVALID_TILE.
* @param score The current (performance) score of the company.
*/
void UpdateCompanyHQ(TileIndex tile, uint score);
/**
* Actually build the unmovable object.
* @param type The type of object to build.
* @param tile The tile to build the northern tile of the object on.
* @param owner The owner of the object.
* @param index A (generic) index to be stored on the tile, e.g. TownID for statues.
* @pre All preconditions for building the object at that location
* are met, e.g. slope and clearness of tiles are checked.
*/
void BuildUnmovable(UnmovableType type, TileIndex tile, CompanyID owner = OWNER_NONE, uint index = 0);
/** Various object behaviours. */
enum ObjectFlags {
OBJECT_FLAG_NONE = 0, ///< Just nothing.
OBJECT_FLAG_ONLY_IN_SCENEDIT = 1 << 0, ///< Object can only be constructed in the scenario editor.
OBJECT_FLAG_CANNOT_REMOVE = 1 << 1, ///< Object can not be removed.
OBJECT_FLAG_AUTOREMOVE = 1 << 2, ///< Object get automatically removed (like "owned land").
OBJECT_FLAG_BUILT_ON_WATER = 1 << 3, ///< Object can be built on water (not required).
OBJECT_FLAG_CLEAR_INCOME = 1 << 4, ///< When object is cleared a positive income is generated instead of a cost.
OBJECT_FLAG_HAS_NO_FOUNDATION = 1 << 5, ///< Do not display foundations when on a slope.
OBJECT_FLAG_ANIMATION = 1 << 6, ///< Object has animated tiles.
OBJECT_FLAG_ONLY_IN_GAME = 1 << 7, ///< Object can only be built in game.
OBJECT_FLAG_2CC_COLOUR = 1 << 8, ///< Object wants 2CC colour mapping.
OBJECT_FLAG_NOT_ON_LAND = 1 << 9, ///< Object can not be on land, implicitly sets #OBJECT_FLAG_BUILT_ON_WATER.
OBJECT_FLAG_DRAW_WATER = 1 << 10, ///< Object wants to be drawn on water.
OBJECT_FLAG_ALLOW_UNDER_BRIDGE = 1 << 11, ///< Object can built under a bridge.
OBJECT_FLAG_REQUIRE_FLAT = 1 << 12, ///< Object can only be build of flat land, i.e. not on foundations!
};
DECLARE_ENUM_AS_BIT_SET(ObjectFlags)
/** An (unmovable) object that isn't use for transport, industries or houses. */
struct UnmovableSpec {
StringID name; ///< The name for this object.
uint8 size; ///< The size of this objects; low nibble for X, high nibble for Y.
uint8 build_cost_multiplier; ///< Build cost multiplier per tile.
uint8 clear_cost_multiplier; ///< Clear cost multiplier per tile.
ObjectFlags flags; ///< Flags/settings related to the object.
/**
* 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); }
/**
* Get the specification associated with a specific UnmovableType.
* @param index The unmovable type to fetch.
* @return The specification.
*/
static const UnmovableSpec *Get(UnmovableType index);
/**
* 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);
};
#endif /* UNMOVABLE_H */
|