OpenTTD Source  20241120-master-g6d3adc6169
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 (DoCommandFlag flags, TileIndex tile, ObjectType type, uint8_t view)
 Build an object object. More...
 
CommandCost CmdBuildObjectArea (DoCommandFlag flags, TileIndex tile, TileIndex start_tile, ObjectType type, uint8_t view, bool diagonal)
 Construct multiple objects in an area. More...
 

Detailed Description

Command definitions related to objects.

Definition in file object_cmd.h.

Function Documentation

◆ CmdBuildObject()

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

Build an object object.

Parameters
flagstype of operation
tiletile where the object will be located
typethe object type to build
viewthe view for the object
Returns
the cost of this operation or an error

Definition at line 210 of file object_cmd.cpp.

References CMD_ERROR, EXPENSES_CONSTRUCTION, and ObjectSpec::Get().

◆ CmdBuildObjectArea()

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

Construct multiple objects in an area.

Parameters
flagsof operation to conduct
tileend tile of area dragging
start_tilestart tile of area dragging
typethe object type to build
viewthe view for the object
diagonalWhether to use the Orthogonal (0) or Diagonal (1) iterator.
Returns
the cost of this operation or an error

Definition at line 391 of file object_cmd.cpp.

References _current_company, CommandCost::AddCost(), CompanyProperties::build_object_limit, CMD_ERROR, TileIterator::Create(), DC_EXEC, EXPENSES_CONSTRUCTION, CommandCost::Failed(), GB(), ObjectSpec::Get(), GetAvailableMoneyForCommand(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), INVALID_TILE, OBJECT_SIZE_1X1, Map::Size(), ObjectSpec::size, and ObjectSpec::views.