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=NULL, uint8 view=0)
| Actually build the object.
void | PlaceProc_Object (TileIndex tile)
| PlaceProc function, called when someone pressed the button if the object-tool is selected.
void | ShowBuildObjectPicker (struct Window *w)
| Show our object picker.

## Detailed Description

Functions related to objects.

Definition in file object.h.

## Function Documentation

void BuildObject | ( | ObjectType | type,
|  | TileIndex | tile,
|  | CompanyID | owner,
|  | Town * | town,
|  | uint8 | 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 83 of file object_cmd.cpp.

References _date, Object::build_date, CalcClosestTownFromTile(), CALLBACK_FAILED, ObjectSpec::callback_mask, CBID_OBJECT_COLOUR, CBM_OBJ_COLOUR, Object::colour, Livery::colour1, Livery::colour2, DirtyCompanyInfrastructureWindows(), ErrorUnknownCallbackResult(), ObjectSpec::flags, GB(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), ObjectSpec::Get(), GetObjectCallback(), GetWaterClass(), ObjectSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, HasBit(), Object::IncTypeCount(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, IsTileOwner(), IsWaterTile(), Object::location, MakeObject(), MarkTileDirtyByTile(), OAT_BUILT, OBJECT_FLAG_2CC_COLOUR, OBJECT_FLAG_ANIMATION, OWNER_NONE, OWNER_WATER, ObjectSpec::size, TILE_AREA_LOOP, Object::town, TriggerObjectAnimation(), Object::type, Object::view, and WATER_CLASS_CANAL.

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

void PlaceProc_Object | ( | TileIndex | tile | ) |

PlaceProc function, called when someone pressed the button if the object-tool is selected.

Parameters:

  | tile | on which to place the object

Definition at line 500 of file object_gui.cpp.

References _selected_object_class, _selected_object_index, _selected_object_view, CMD_BUILD_OBJECT, CMD_MSG, DoCommandP(), and NewGRFClass< Tspec, Tid, Tmax >::Get().

Referenced by ScenarioEditorLandscapeGenerationWindow::OnPlaceObject(), and TerraformToolbarWindow::OnPlaceObject().

void ShowBuildObjectPicker | ( | Window * | w | ) |

Show our object picker.

Parameters:

  | w | The toolbar window we're associated with.

Definition at line 484 of file object_gui.cpp.

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

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 155 of file object_cmd.cpp.

References GetCompanyHQSize, IncreaseCompanyHQSize, and INVALID_TILE.

Referenced by CmdBuildObject(), and UpdateCompanyRatingAndValue().