OpenTTD Source: src/object_cmd.h File Reference

OpenTTD Source 15.3

Functions
object_cmd.h File Reference

Command definitions related to objects. More...

`#include "command_type.h"`
`#include "object_type.h"`

Go to the source code of this file.

## Functions
CommandCost | CmdBuildObject (DoCommandFlags flags, TileIndex tile, ObjectType type, uint8_t view)
| Build an object object.
CommandCost | CmdBuildObjectArea (DoCommandFlags flags, TileIndex tile, TileIndex start_tile, ObjectType type, uint8_t view, bool diagonal)
| Construct multiple objects in an area.

## Detailed Description

Command definitions related to objects.

Definition in file object_cmd.h.

## Function Documentation

## ◆ CmdBuildObject()

CommandCost CmdBuildObject | ( | DoCommandFlags | flags,
|  | TileIndex | tile,
|  | ObjectType | type,
|  | uint8_t | view
| ) |  |

Build an object object.

Parameters

  flags | type of operation
  tile | tile where the object will be located
  type | the object type to build
  view | the view for the object

Returns
  the cost of this operation or an error

Definition at line 210 of file object_cmd.cpp.

References _current_company, _generating_world, _settings_game, CommandCost::AddCost(), AllowUnderBridge, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Any(), CompanyProperties::build_object_limit, BuildObject(), BuiltOnWater, CALLBACK_FAILED, ObjectSpec::callback_mask, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_object_pool >::CanAllocateItem(), CBID_OBJECT_LAND_SLOPE_CHECK, CheckBuildableTile(), CheckOwnership(), CMD_ERROR, GameSettings::construction, EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), ObjectSpec::flags, ConstructionSettings::freeform_edges, GB(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), ObjectSpec::Get(), GetBridgeHeight(), ObjectSpec::GetBuildCost(), GetErrorMessageFromLocationCallbackResult(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_town_pool >::GetNumItems(), GetObjectCallback(), GetSouthernBridgeEnd(), GetTileMaxZ(), GetTileOwner(), GetTileSlope(), GetTileSlopeZ(), ObjectSpec::grf_prop, GRFFilePropsBase::grffile, HasBit(), HasTileWaterGround(), ObjectSpec::height, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, INVALID_TILE, ObjectSpec::IsAvailable(), IsBridgeAbove(), IsInsideMM(), IsObjectType(), IsTileFlat(), IsTileOwner(), IsTileType(), IsValidTile(), IsWaterTile(), CompanyProperties::location_of_HQ, Map::MaxX(), Map::MaxY(), MP_OBJECT, NotOnLand, NoWater, OBJECT_HQ, OBJECT_LIGHTHOUSE, OBJECT_OWNED_LAND, OBJECT_STATUE, OBJECT_TRANSMITTER, OnlyInGame, OnlyInScenedit, OWNER_DEITY, OWNER_NONE, OWNER_WATER, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), SetWindowDirty(), ObjectSpec::size, SLOPE_FLAT, SlopeCheck, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileX(), TileY(), ToggleBit(), UpdateCompanyHQ(), UpdateCompanyRatingAndValue(), ObjectSpec::views, ObjectSpec::WasEverAvailable(), and WC_COMPANY.

## ◆ CmdBuildObjectArea()

CommandCost CmdBuildObjectArea | ( | DoCommandFlags | flags,
|  | TileIndex | tile,
|  | TileIndex | start_tile,
|  | ObjectType | type,
|  | uint8_t | view,
|  | bool | diagonal
| ) |  |

Construct multiple objects in an area.

Parameters

  flags | of operation to conduct
  tile | end tile of area dragging
  start_tile | start tile of area dragging
  type | the object type to build
  view | the view for the object
  diagonal | Whether to use the Orthogonal (0) or Diagonal (1) iterator.

Returns
  the cost of this operation or an error

Definition at line 397 of file object_cmd.cpp.

References _current_company, CommandCost::AddCost(), CompanyProperties::build_object_limit, CMD_ERROR, TileIterator::Create(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), GB(), ObjectSpec::Get(), GetAvailableMoneyForCommand(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::GetIfValid(), INVALID_TILE, OBJECT_SIZE_1X1, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), Map::Size(), ObjectSpec::size, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and ObjectSpec::views.