OpenTTD Source: src/object.h File Reference

OpenTTD Source 15.3

Functions
object.h File Reference

Functions related to objects. More...

`#include "tile_type.h"`
`#include "company_type.h"`
`#include "object_type.h"`

Go to the source code of this file.

## Functions
void | UpdateCompanyHQ (TileIndex tile, uint score)
| Update the CompanyHQ to the state associated with the given score.
void | BuildObject (ObjectType type, TileIndex tile, CompanyID owner=OWNER_NONE, struct Town *town=nullptr, uint8_t view=0)
| Actually build the object.
Window * | ShowBuildObjectPicker ()
| Show our object picker.

## Detailed Description

Functions related to objects.

Definition in file object.h.

## Function Documentation

## ◆ BuildObject()

void BuildObject | ( | ObjectType | type,
|  | TileIndex | tile,
|  | CompanyID | owner,
|  | Town * | town,
|  | uint8_t | view
| ) |  |

Actually build the object.

Parameters

  type | The type of object to build.
  tile | The tile to build the northern tile of the object on.
  owner | The owner of the object.
  town | Town the tile is related with.
  view | The view for the object.

Precondition
  All preconditions for building the object at that location are met, e.g. slope and clearness of tiles are checked.

Definition at line 88 of file object_cmd.cpp.

References Animation, Built, CalcClosestTownFromTile(), CALLBACK_FAILED, ObjectSpec::callback_mask, Canal, CBID_OBJECT_COLOUR, ClearNeighbourNonFloodingStates(), Colour, Object::colour, TimerGameCalendar::date, DirtyCompanyInfrastructureWindows(), ErrorUnknownCallbackResult(), ObjectSpec::flags, GB(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), ObjectSpec::Get(), GetObjectCallback(), GetWaterClass(), ObjectSpec::grf_prop, GRFFilePropsBase::grfid, HasBit(), HasTileWaterGround(), Object::IncTypeCount(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, Invalid, InvalidateWaterRegion(), IsDockingTile(), IsTileOwner(), IsWaterTile(), MakeObject(), MarkTileDirtyByTile(), OWNER_NONE, OWNER_WATER, Random, ObjectSpec::size, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Object::town, TriggerObjectAnimation(), and Uses2CC.

Referenced by CmdBuildObject(), TownActionBuildStatue(), TryBuildLightHouse(), and TryBuildTransmitter().

## ◆ ShowBuildObjectPicker()

Window * ShowBuildObjectPicker | ( |  | ) |

Show our object picker.

Definition at line 425 of file object_gui.cpp.

Referenced by BuildObjectWindow::BuildObjectGlobalHotkeys(), TerraformToolbarWindow::OnClick(), and ScenarioEditorLandscapeGenerationWindow::OnClick().

## ◆ UpdateCompanyHQ()

void UpdateCompanyHQ | ( | TileIndex | tile,
|  | uint | score
| ) |  |

Update the CompanyHQ to the state associated with the given score.

Parameters

  tile | The (northern) tile of the company HQ, or INVALID_TILE.
  score | The current (performance) score of the company.

Definition at line 165 of file object_cmd.cpp.

References GetCompanyHQSize(), IncreaseCompanyHQSize(), and INVALID_TILE.

Referenced by CmdBuildObject(), and UpdateCompanyRatingAndValue().