OpenTTD Source: src/object_cmd.h File Reference

OpenTTD Source 13.2.1

Functions
object_cmd.h File Reference
`#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 view)
| Build an object object. More...
CommandCost | CmdBuildObjectArea (DoCommandFlag flags, TileIndex tile, TileIndex start_tile, ObjectType type, uint8 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 | 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 206 of file object_cmd.cpp.

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

## ◆ CmdBuildObjectArea()

CommandCost CmdBuildObjectArea | ( | DoCommandFlag | flags,
|  | TileIndex | tile,
|  | TileIndex | start_tile,
|  | ObjectType | type,
|  | uint8 | 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 387 of file object_cmd.cpp.

References _current_company, CMD_ERROR, EXPENSES_CONSTRUCTION, ObjectSpec::Get(), GetAvailableMoneyForCommand(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), MapSize(), NUM_OBJECTS, OBJECT_SIZE_1X1, ObjectSpec::size, and ObjectSpec::views.