OpenTTD Source  12.0-beta2
object.h File Reference
#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. More...
 
void BuildObject (ObjectType type, TileIndex tile, CompanyID owner=OWNER_NONE, struct Town *town=nullptr, uint8 view=0)
 Actually build the object. More...
 
WindowShowBuildObjectPicker ()
 Show our object picker. More...
 

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  view 
)

Actually build the object.

Parameters
typeThe type of object to build.
tileThe tile to build the northern tile of the object on.
ownerThe owner of the object.
townTown the tile is related with.
viewThe 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(), Object::colour, GB(), ObjectSpec::Get(), HasBit(), Object::location, OWNER_NONE, ObjectSpec::size, Object::town, Object::type, and Object::view.

Referenced by TryBuildTransmitter().

◆ ShowBuildObjectPicker()

Window* ShowBuildObjectPicker ( )

Show our object picker.


Definition at line 712 of file object_gui.cpp.

◆ UpdateCompanyHQ()

void UpdateCompanyHQ ( TileIndex  tile,
uint  score 
)

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

Parameters
tileThe (northern) tile of the company HQ, or INVALID_TILE.
scoreThe current (performance) score of the company.

Definition at line 155 of file object_cmd.cpp.

References GetCompanyHQSize, IncreaseCompanyHQSize, and INVALID_TILE.