Functions related to water (management). More...
#include "tile_type.h"
#include "company_type.h"
#include "slope_type.h"
#include "economy_func.h"
#include "core/math_func.hpp"
Go to the source code of this file.
Enumerations | |
enum | FloodingBehaviour { FLOOD_NONE, FLOOD_ACTIVE, FLOOD_PASSIVE, FLOOD_DRYUP } |
Describes the behaviour of a tile during flooding. More... | |
Functions | |
FloodingBehaviour | GetFloodingBehaviour (TileIndex tile) |
Returns the behaviour of a tile during flooding. | |
void | TileLoop_Water (TileIndex tile) |
Let a water tile floods its diagonal adjoining tiles called from tunnelbridge_cmd, and by TileLoop_Industry() and TileLoop_Track(). | |
bool | FloodHalftile (TileIndex t) |
Called from water_cmd if a non-flat rail-tile gets flooded and should be converted to shore. | |
void | DoFloodTile (TileIndex target) |
Floods a tile. | |
void | ConvertGroundTilesIntoWaterTiles () |
void | DrawShipDepotSprite (int x, int y, int image) |
void | DrawWaterClassGround (const struct TileInfo *ti) |
void | DrawShoreTile (Slope tileh) |
void | MakeWaterKeepingClass (TileIndex tile, Owner o) |
static Money | CanalMaintenanceCost (uint32 num) |
Calculates the maintenance cost of a number of canal tiles. |
Functions related to water (management).
Definition in file water.h.
enum FloodingBehaviour |
Describes the behaviour of a tile during flooding.
static Money CanalMaintenanceCost | ( | uint32 | num | ) | [inline, static] |
Calculates the maintenance cost of a number of canal tiles.
num | Number of canal tiles. |
Definition at line 50 of file water.h.
References IntSqrt().
Referenced by CompaniesGenStatistics(), CompanyInfrastructureWindow::DrawWidget(), CompanyInfrastructureWindow::GetTotalMaintenanceCost(), and CompanyInfrastructureWindow::UpdateWidgetSize().
bool FloodHalftile | ( | TileIndex | t | ) |
Called from water_cmd if a non-flat rail-tile gets flooded and should be converted to shore.
The function floods the lower halftile, if the tile has a halftile foundation.
t | The tile to flood. |
Definition at line 691 of file rail_cmd.cpp.
References _current_company, ApplyFoundationToSlope(), CMD_REMOVE_SINGLE_RAIL, CornerToTrackBits(), DC_EXEC, DoCommand(), FIND_FIRST_BIT, GetHighestSlopeCorner(), GetRailFoundation(), GetTileSlope(), GetTrackBits(), IsNonContinuousFoundation(), IsPlainRailTile(), IsSlopeWithOneCornerRaised(), IsSlopeWithThreeCornersRaised(), IsSteepSlope(), MakeShore(), MarkTileDirtyByTile(), OppositeCorner(), OWNER_WATER, RAIL_GROUND_WATER, Backup< T >::Restore(), and CommandCost::Succeeded().
Referenced by DoFloodTile().
FloodingBehaviour GetFloodingBehaviour | ( | TileIndex | tile | ) |
Returns the behaviour of a tile during flooding.
Definition at line 977 of file water_cmd.cpp.
References FLOOD_ACTIVE, FLOOD_DRYUP, FLOOD_NONE, GetTileSlope(), GetTileType(), GetTreeGround(), GetWaterClass(), IsCoast(), IsSlopeWithOneCornerRaised(), MP_INDUSTRY, MP_OBJECT, MP_RAILWAY, MP_STATION, MP_TREES, MP_WATER, RAIL_GROUND_WATER, TREE_GROUND_SHORE, and WATER_CLASS_SEA.
Referenced by CheckRailSlope(), and TileLoop_Water().
void TileLoop_Water | ( | TileIndex | tile | ) |
Let a water tile floods its diagonal adjoining tiles called from tunnelbridge_cmd, and by TileLoop_Industry() and TileLoop_Track().
tile | the water/shore tile that floods |
Definition at line 1125 of file water_cmd.cpp.
References _flood_from_dirs, AddTileIndexDiffCWrap(), DIR_BEGIN, DoDryUp(), DoFloodTile(), FLOOD_ACTIVE, FLOOD_DRYUP, FLOOD_PASSIVE, FOR_EACH_SET_BIT, GetFloodingBehaviour(), GetFoundationSlope(), HasBit(), INVALID_TILE, IsTileType(), MP_WATER, ReverseDir(), SLOPE_HALFTILE_MASK, and TileIndexDiffCByDir().