41#include "table/strings.h"
115 assert(o->
town !=
nullptr);
128 if (remove) RemoveDockingTile(t);
171 if (score >= 170) val++;
172 if (score >= 350) val++;
173 if (score >= 520) val++;
174 if (score >= 720) val++;
190 if (owner != c->
index)
continue;
196 const Livery &l = c->livery[0];
216 if (type >= ObjectSpec::Count())
return CMD_ERROR;
228 int size_x =
GB(spec->
size,
HasBit(view, 0) ? 4 : 0, 4);
229 int size_y =
GB(spec->
size,
HasBit(view, 0) ? 0 : 4, 4);
246 if (!allow_water)
return CommandCost(STR_ERROR_CAN_T_BUILD_ON_WATER);
260 if (!allow_ground)
return CommandCost(STR_ERROR_MUST_BE_BUILT_ON_WATER);
279 std::array<int32_t, 16> regs100;
291 if (ret.
Failed())
return ret;
309 if (cost.
Failed())
return cost;
316 return CommandCost(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
321 uint build_object_size = 1;
360 build_object_size = size_x * size_y;
367 return CommandCost(STR_ERROR_BUILD_OBJECT_LIMIT_REACHED);
398 if (type >= ObjectSpec::Count())
return CMD_ERROR;
407 bool had_success =
false;
418 if (c !=
nullptr && limit-- <= 0)
break;
421 last_error = std::move(ret);
430 if (ret.
GetCost() > 0 && money < 0)
break;
436 return had_success ? cost : last_error;
441static void DrawTile_Object(
TileInfo *ti)
460 dts = &_objects[type];
467 case SPR_FLAT_BARE_LAND: DrawClearLandTile(ti, 0);
break;
468 case SPR_FLAT_1_THIRD_GRASS_TILE: DrawClearLandTile(ti, 1);
break;
469 case SPR_FLAT_2_THIRD_GRASS_TILE: DrawClearLandTile(ti, 2);
break;
470 case SPR_FLAT_GRASS_TILE: DrawClearLandTile(ti, 3);
break;
480 dtss.image.sprite, palette,
481 ti->
x + dtss.delta_x, ti->
y + dtss.delta_y,
482 dtss.size_x, dtss.size_y,
483 dtss.size_z, ti->
z + dtss.delta_z,
495static int GetSlopePixelZ_Object(
TileIndex tile, uint x, uint y,
bool)
521 MakeWaterKeepingClass(tile_cur,
GetTileOwner(tile_cur));
526std::vector<ClearedObjectArea> _cleared_object_areas;
538 if (coa.area.Intersects(ta))
return &coa;
563 return CommandCost(STR_ERROR_CAN_T_BUILD_ON_WATER);
566 return CommandCost(type ==
OBJECT_HQ ? STR_ERROR_COMPANY_HEADQUARTERS_IN : STR_ERROR_OBJECT_IN_THE_WAY);
567 }
else if (_game_mode == GM_EDITOR) {
585 }
else if (spec->
flags.
Any({ObjectFlag::BuiltOnWater, ObjectFlag::NotOnLand})) {
616 _cleared_object_areas.emplace_back(tile, ta);
623static void AddAcceptedCargo_Object(
TileIndex tile,
CargoArray &acceptance, CargoTypes &always_accepted)
637 acceptance[pass] += std::max(1U, level);
638 SetBit(always_accepted, pass);
645 CargoType mail = GetCargoTypeByLabel(CT_MAIL);
647 acceptance[mail] += std::max(1U, level / 2);
648 SetBit(always_accepted, mail);
658 CargoType mail = GetCargoTypeByLabel(CT_MAIL);
675static void TileLoop_Object(
TileIndex tile)
701 uint amt =
GB(r, 0, 8) / 8 / 4 + 1;
715 CargoType mail = GetCargoTypeByLabel(CT_MAIL);
717 uint amt =
GB(r, 8, 8) / 8 / 4 + 1;
735static bool ClickTile_Object(
TileIndex tile)
743static void AnimateTile_Object(
TileIndex tile)
759 int perimeter = (
GB(r, 16, 16) % (2 * (maxx + maxy))) - maxy;
761 for (dir =
DIAGDIR_NE; perimeter > 0; dir++) {
777 for (
int j = 0; j < 19; j++) {
808void GenerateObjects()
814 uint num_water_tiles = 0;
820 for (uint y = 1; y <
Map::MaxY() - 1; y++) {
827 for (
const auto &spec :
ObjectSpec::Specs()) {
848 switch (spec.
Index()) {
871 bool do_clear =
false;
940 GetSlopePixelZ_Object,
942 AddAcceptedCargo_Object,
944 GetTileTrackStatus_Object,
948 ChangeTileOwner_Object,
949 AddProducedCargo_Object,
951 GetFoundation_Object,
952 TerraformTile_Object,
Functions related to autoslope.
bool AutoslopeEnabled()
Tests if autoslope is enabled for _current_company.
debug_inline constexpr bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
debug_inline static constexpr uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
constexpr T ToggleBit(T &x, const uint8_t y)
Toggles a bit in a variable.
void DrawBridgeMiddle(const TileInfo *ti)
Draw the middle bits of a bridge.
TileIndex GetSouthernBridgeEnd(TileIndex t)
Finds the southern end of a bridge starting at a middle tile.
int GetBridgeHeight(TileIndex t)
Get the height ('z') of a bridge.
Map accessor functions for bridges.
bool IsBridgeAbove(Tile t)
checks if a bridge is set above the ground of this tile
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
bool IsValidCargoType(CargoType cargo)
Test whether cargo type is not INVALID_CARGO.
static constexpr CargoLabel CT_PASSENGERS
Available types of cargo Labels may be re-used between different climates.
Base class for cargo packets.
Cheats _cheats
All the cheats.
Types related to cheating.
constexpr bool Test(Tvalue_type value) const
Test if the value-th bit is set.
constexpr Timpl & Reset()
Reset all bits.
constexpr Timpl & Set()
Set all bits.
constexpr bool Any(const Timpl &other) const
Test if any of the given values are set.
Common return value for all commands.
bool Succeeded() const
Did this command succeed?
void AddCost(const Money &cost)
Adds the given cost to the cost of the command.
Money GetCost() const
The costs as made up to this moment.
bool Failed() const
Did this command fail?
void MultiplyCost(int factor)
Multiplies the cost of the command by the given factor.
Generate TileIndices around a center tile or tile area, with increasing distance.
Structure contains cached list of stations nearby.
static std::unique_ptr< TileIterator > Create(TileIndex corner1, TileIndex corner2, bool diagonal)
Create either an OrthogonalTileIterator or DiagonalTileIterator given the diagonal parameter.
Wrapper class to abstract away the way the tiles are stored.
static Date date
Current date in days (day counter).
Functions related to clear (MP_CLEAR) land.
Functions related to commands.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
@ Execute
execute the given command
@ NoModifyTownRating
do not change town rating
@ NoTestTownRating
town rating does not disallow you from building
@ NoWater
don't allow building on water
@ Auto
don't allow building on structures
Definition of stuff that is very close to a company, like the company struct itself.
Money CalculateCompanyValue(const Company *c, bool including_loan=true)
Calculate the value of the company.
CommandCost CheckTileOwnership(TileIndex tile)
Check whether the current owner owns the stuff on the given tile.
PaletteID GetCompanyPalette(CompanyID company)
Get the palette for recolouring with a company colour.
Money GetAvailableMoneyForCommand()
This functions returns the money which can be used to execute a command.
CommandCost CheckOwnership(Owner owner, TileIndex tile)
Check whether the current owner owns something.
CompanyID _current_company
Company currently doing an action.
Functions related to companies.
void ShowCompany(CompanyID company)
Show the window with the overview of the company.
void DirtyCompanyInfrastructureWindows(CompanyID company)
Redraw all windows with company infrastructure counts.
GUI Functions related to companies.
static constexpr Owner OWNER_DEITY
The object is owned by a superuser / goal script.
static constexpr Owner OWNER_TOWN
A town owns the tile, or a town is expanding.
static constexpr Owner OWNER_NONE
The tile has no ownership.
static constexpr Owner INVALID_OWNER
An invalid owner.
static constexpr Owner OWNER_WATER
The tile/execution is done by "water".
Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
DiagDirection
Enumeration for diagonal directions.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
int UpdateCompanyRatingAndValue(Company *c, bool update)
if update is set to true, the economy is updated with this score (also the house is updated,...
bool EconomyIsInRecession()
Is the economy in recession?
uint ScaleByCargoScale(uint num, bool town)
Scale a number by the cargo scale setting.
@ EXPENSES_CONSTRUCTION
Construction costs.
bool _generating_world
Whether we are generating the map or not.
Functions related to world/map generation.
void IncreaseGeneratingWorldProgress(GenWorldProgress cls)
Increases the current stage of the world generation with one.
@ GWP_OBJECT
Generate objects (radio tower, light houses)
void SetGeneratingWorldProgress(GenWorldProgress cls, uint total)
Set the total of a stage of the world generation.
uint32_t PaletteID
The number of the palette.
void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset, int tile_height_override)
Mark a tile given by its index dirty for repaint.
uint GetPartialPixelZ(int x, int y, Slope corners)
Determines height at given coordinate of a slope.
void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner)
Change the owner of a tile.
void DrawFoundation(TileInfo *ti, Foundation f)
Draw foundation f at tile ti.
Functions related to OTTD's landscape.
Command definitions related to landscape (slopes etc.).
@ Random
Randomise borders.
static debug_inline TileIndex TileXY(uint x, uint y)
Returns the TileIndex of a coordinate.
#define RandomTile()
Get a valid random tile.
static debug_inline uint TileY(TileIndex tile)
Get the Y component of a tile.
static debug_inline uint TileX(TileIndex tile)
Get the X component of a tile.
TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
@ CBID_OBJECT_LAND_SLOPE_CHECK
Callback done for each tile of an object to check the slope.
@ CBID_OBJECT_AUTOSLOPE
Called to determine if one can alter the ground below an object tile.
@ CBID_OBJECT_COLOUR
Called to determine the colour of a town building.
@ Autoslope
decides allowance of autosloping
@ Colour
decide the colour of the building
@ SlopeCheck
decides slope suitability
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
void ErrorUnknownCallbackResult(uint32_t grfid, uint16_t cbid, uint16_t cb_res)
Record that a NewGRF returned an unknown/invalid callback result.
CommandCost GetErrorMessageFromLocationCallbackResult(uint16_t cb_res, std::span< const int32_t > textstack, const GRFFile *grffile, StringID default_error)
Get the error message from a shape/location/slope check callback result.
bool ConvertBooleanCallback(const GRFFile *grffile, uint16_t cbid, uint16_t cb_res)
Converts a callback result into a boolean.
GRFConfig * GetGRFConfig(uint32_t grfid, uint32_t mask)
Retrieve a NewGRF from the current config by its grfid.
Functions to find and configure NewGRFs.
Functions/types related to NewGRF debugging.
void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index)
Delete inspect window for a given feature and index.
void DrawNewObjectTile(TileInfo *ti, const ObjectSpec *spec)
Draw an object on the map.
bool TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
Trigger the update of animation on a whole object.
bool TriggerObjectTileAnimation(Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
Trigger the update of animation on a single tile.
void AnimateNewObjectTile(TileIndex tile)
Handle the animation of the object tile.
uint16_t GetObjectCallback(CallbackID callback, uint32_t param1, uint32_t param2, const ObjectSpec *spec, Object *o, TileIndex tile, std::span< int32_t > regs100, uint8_t view)
Perform a callback for an object.
Functions related to NewGRF objects.
static const uint8_t OBJECT_SIZE_1X1
The value of a NewGRF's size property when the object is 1x1 tiles: low nibble for X,...
@ Autoremove
Object get automatically removed (like "owned land").
@ CannotRemove
Object can not be removed.
@ AllowUnderBridge
Object can built under a bridge.
@ OnlyInScenedit
Object can only be constructed in the scenario editor.
@ BuiltOnWater
Object can be built on water (not required).
@ OnlyInGame
Object can only be built in game.
@ HasNoFoundation
Do not display foundations when on a slope.
@ Uses2CC
Object wants 2CC colour mapping.
@ NotOnLand
Object can not be on land, implicitly sets ObjectFlag::BuiltOnWater.
@ ScaleByWater
Object count is roughly scaled by water amount at edges.
@ Animation
Object has animated tiles.
@ ClearIncome
When object is cleared a positive income is generated instead of a cost.
Functions related to objects.
void UpdateObjectColours(const Company *c)
Updates the colour of the object whenever a company changes.
void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, uint8_t view)
Actually build the object.
static void ReallyClearObjectTile(Object *o)
Perform the actual removal of the object from the map.
CommandCost CheckBuildableTile(TileIndex tile, DiagDirections invalid_dirs, int &allowed_z, bool allow_steep, bool check_bridge)
Checks if the given tile is buildable, flat and has a certain height.
void InitializeObjects()
Initialize/reset the objects.
static uint8_t GetCompanyHQSize(TileIndex tile)
Get the size of the HQ.
static bool TryBuildTransmitter()
Try to build a transmitter.
CommandCost CmdBuildObjectArea(DoCommandFlags flags, TileIndex tile, TileIndex start_tile, ObjectType type, uint8_t view, bool diagonal)
Construct multiple objects in an area.
static bool TryBuildLightHouse()
Try to build a lighthouse.
ObjectType GetObjectType(Tile t)
Gets the ObjectType of the given object tile.
void UpdateCompanyHQ(TileIndex tile, uint score)
Update the CompanyHQ to the state associated with the given score.
ClearedObjectArea * FindClearedObject(TileIndex tile)
Find the entry in _cleared_object_areas which occupies a certain tile.
static void IncreaseCompanyHQSize(TileIndex tile)
Increase the HQ size.
CommandCost CmdBuildObject(DoCommandFlags flags, TileIndex tile, ObjectType type, uint8_t view)
Build an object object.
Command definitions related to objects.
Sprites to use and how to display them for object tiles.
Map accessors for object tiles.
void MakeObject(Tile t, Owner o, ObjectID index, WaterClass wc, uint8_t random)
Make an Object tile.
bool IsObjectTypeTile(Tile t, ObjectType type)
Check whether a tile is a object tile of a specific type.
bool IsObjectType(Tile t, ObjectType type)
Check whether the object on a tile is of a specific type.
ObjectID GetObjectIndex(Tile t)
Get the index of which object this tile is attached to.
static const ObjectType OBJECT_LIGHTHOUSE
The nice lighthouse.
uint16_t ObjectType
Types of objects.
static const ObjectType OBJECT_STATUE
Statue in towns.
static const ObjectType OBJECT_HQ
HeadQuarter of a player.
static const ObjectType OBJECT_TRANSMITTER
The large antenna.
@ Built
Triggered when the object is built (for all tiles at the same time).
@ TileLoop
Triggered in the periodic tile loop.
@ TileLoopNorth
Triggered every 256 ticks (for all tiles at the same time).
static const ObjectType NEW_OBJECT_OFFSET
Offset for new objects.
static const ObjectType OBJECT_OWNED_LAND
Owned land 'flag'.
Some methods of Pool are placed here in order to reduce compilation time and binary size.
#define INSTANTIATE_POOL_METHODS(name)
Force instantiation of pool methods so we don't get linker errors.
Pseudo random number generator.
uint32_t RandomRange(uint32_t limit, const std::source_location location=std::source_location::current())
Pick a random number between 0 and limit - 1, inclusive.
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
static constexpr int GetSlopeMaxZ(Slope s)
Returns the height of the highest corner of a slope relative to TileZ (= minimal height)
static constexpr bool IsSteepSlope(Slope s)
Checks if a slope is steep.
Foundation FlatteningFoundation(Slope s)
Returns the foundation needed to flatten a slope.
Slope
Enumeration for the slope-type.
Foundation
Enumeration for Foundations.
@ FOUNDATION_NONE
The tile has no foundation, the slope remains unchanged.
@ Headquarters
Source/destination are company headquarters.
Functions related to stations.
Definition of base types and functions in a cross-platform compatible way.
Class for storing amounts of cargo.
static void InvalidateAllFrom(Source src)
Invalidates (sets source_id to INVALID_SOURCE) all cargo packets from given source.
bool value
tells if the bool cheat is active or not
Cheat magic_bulldozer
dynamite industries, objects
Keeps track of removed objects during execution/testruns of commands.
TileIndex location_of_HQ
Northern tile of HQ; INVALID_TILE when there is none.
uint32_t build_object_limit
Amount of tiles we can (still) build objects on (times 65536). Also applies to buying land.
bool freeform_edges
allow terraforming the tiles at the map edges
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
Ground palette sprite of a tile, together with its sprite layout.
PalSpriteID ground
Palette and sprite for the ground.
std::string GetName() const
Get the name of this grf.
const struct GRFFile * grffile
grf file that introduced this entity
uint32_t grfid
grfid that introduced this entity.
bool HasGrfFile() const
Test if this entity was introduced by NewGRF.
ConstructionSettings construction
construction of things in-game
Information about a particular livery.
Colours colour2
Second colour, for vehicles with 2CC support.
Colours colour1
First colour, for all vehicles.
static uint ScaleBySize(uint n)
Scales the given value by the map size, where the given value is for a 256 by 256 map.
static uint ScaleBySize1D(uint n)
Scales the given value by the maps circumference, where the given value is for a 256 by 256 map.
static uint MaxY()
Gets the maximum Y coordinate within the map, including MP_VOID.
static debug_inline uint Size()
Get the size of the map.
static debug_inline uint MaxX()
Gets the maximum X coordinate within the map, including MP_VOID.
Allow incrementing of ObjectClassID variables.
bool IsEnabled() const
Test if this object is enabled.
StandardGRFFileProps grf_prop
Properties related the the grf file.
StringID name
The name for this object.
static const ObjectSpec * GetByTile(TileIndex tile)
Get the specification associated with a tile.
static const ObjectSpec * Get(ObjectType index)
Get the specification associated with a specific ObjectType.
bool IsAvailable() const
Check whether the object is available at this time.
Money GetClearCost() const
Get the cost for clearing a structure of this type.
uint8_t size
The size of this objects; low nibble for X, high nibble for Y.
uint8_t generate_amount
Number of objects which are attempted to be generated per 256^2 map during world generation.
uint Index() const
Gets the index of this spec.
ObjectCallbackMasks callback_mask
Bitmask of requested/allowed callbacks.
ObjectFlags flags
Flags/settings related to the object.
uint8_t height
The height of this structure, in heightlevels; max MAX_TILE_HEIGHT.
bool WasEverAvailable() const
Check whether the object was available at some point in the past or present in this game with the cur...
Money GetBuildCost() const
Get the cost for building a structure of this type.
uint8_t views
The number of views.
An object, such as transmitter, on the map.
ObjectType type
Type of the object.
Town * town
Town the object is built in.
static std::array< uint16_t, NUM_OBJECTS > counts
Number of objects per type ingame.
static Object * GetByTile(TileIndex tile)
Get the object associated with a tile.
static void IncTypeCount(ObjectType type)
Increment the count of objects for this type.
TimerGameCalendar::Date build_date
Date of construction.
TileArea location
Location of the object.
uint8_t colour
Colour of the object, for display purpose.
static void DecTypeCount(ObjectType type)
Decrement the count of objects for this type.
static void ResetTypeCounts()
Resets object counts.
Represents the covered area of e.g.
uint16_t w
The width of the area.
TileIndex tile
The base tile of the area.
uint16_t h
The height of the area.
SpriteID sprite
The 'real' sprite.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
static Titem * Get(auto index)
Returns Titem with given index.
static size_t GetNumItems()
Returns number of valid items in the pool.
Tindex index
Index of this pool item.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function()
static Titem * GetIfValid(auto index)
Returns Titem with given index.
Base class for all pools.
Tile description for the 'land area information' tool.
std::optional< std::string > grf
newGRF used for the tile contents
StringID str
Description of the tile.
TimerGameCalendar::Date build_date
Date of construction of tile contents.
std::array< Owner, 4 > owner
Name of the owner(s)
Tile information, used while rendering the tile.
int x
X position of the tile in unit coordinates.
Slope tileh
Slope of the tile.
TileIndex tile
Tile index.
int y
Y position of the tile in unit coordinates.
Set of callback functions for performing tile operations of a given tile type.
CompanyMask statues
which companies have a statue?
bool IsTileFlat(TileIndex tile, int *h)
Check if a given tile is flat.
std::tuple< Slope, int > GetTileSlopeZ(TileIndex tile)
Return the slope of a given tile inside the map.
int GetTileMaxZ(TileIndex t)
Get top height of the tile inside the map.
bool IsTileOwner(Tile tile, Owner owner)
Checks if a tile belongs to the given owner.
Owner GetTileOwner(Tile tile)
Returns the owner of a tile.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
int GetTileMaxPixelZ(TileIndex tile)
Get top height of the tile.
uint8_t GetAnimationFrame(Tile t)
Get the current animation frame.
std::tuple< Slope, int > GetTilePixelSlope(TileIndex tile)
Return the slope of a given tile.
bool IsValidTile(Tile tile)
Checks if a tile is valid.
void SetAnimationFrame(Tile t, uint8_t frame)
Set a new animation frame.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
Slope GetTileSlope(TileIndex tile)
Return the slope of a given tile inside the map.
constexpr TileIndex INVALID_TILE
The very nice invalid tile marker.
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.
@ MP_OBJECT
Contains objects such as transmitters and owned land.
OrthogonalTileArea TileArea
Shorthand for the much more common orthogonal tile area.
Definition of the game-calendar-timer.
Town * CalcClosestTownFromTile(TileIndex tile, uint threshold=UINT_MAX)
Return the town closest to the given tile within threshold.
bool IsTransparencySet(TransparencyOption to)
Check if the transparency option bit is set and if we aren't in the game menu (there's never transpar...
bool IsInvisibilitySet(TransparencyOption to)
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transpar...
@ TO_STRUCTURES
other objects such as transmitters and lighthouses
TransportType
Available types of transport.
CommandCost EnsureNoVehicleOnGround(TileIndex tile)
Ensure there is no vehicle at the ground at the given position.
Functions related to vehicles.
void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent, int bb_offset_x, int bb_offset_y, int bb_offset_z, const SubSprite *sub)
Draw a (transparent) sprite at given coordinates with a given bounding box.
void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
Draws a ground sprite for the current tile.
Functions related to (drawing on) viewports.
Functions related to water (management)
void TileLoop_Water(TileIndex tile)
Let a water tile floods its diagonal adjoining tiles called from tunnelbridge_cmd,...
void ClearNeighbourNonFloodingStates(TileIndex tile)
Clear non-flooding state of the tiles around a tile.
bool HasTileWaterGround(Tile t)
Checks whether the tile has water at the ground.
bool IsTileOnWater(Tile t)
Tests if the tile was built on water.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
@ WATER_CLASS_CANAL
Canal.
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
WaterClass GetWaterClass(Tile t)
Get the water class at a tile.
bool IsDockingTile(Tile t)
Checks whether the tile is marked as a dockling tile.
bool IsWaterTile(Tile t)
Is it a water tile with plain water?
void InvalidateWaterRegion(TileIndex tile)
Marks the water region that tile is part of as invalid.
Handles dividing the water in the map into regions to assist pathfinding.
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
Window functions not directly related to making/drawing windows.
@ WC_TOWN_AUTHORITY
Town authority; Window numbers:
@ WC_COMPANY
Company view; Window numbers: