# functions.h File Reference

Some generic functions that actually shouldn't be here. More...

`#include "tile_cmd.h"`

Go to the source code of this file.

## Functions
void | DrawHillyLandTile (const TileInfo *ti)
void | DrawClearLandTile (const TileInfo *ti, byte set)
void | DrawClearLandFence (const TileInfo *ti)
void | TileLoopClearHelper (TileIndex tile)
bool | CheckCompanyHasMoney (CommandCost &cost)
void | SubtractMoneyFromCompany (CommandCost cost)
void | SubtractMoneyFromCompanyFract (CompanyID company, CommandCost cost)
bool | CheckOwnership (Owner owner, TileIndex tile=0)
| Check whether the current owner owns something.
bool | CheckTileOwnership (TileIndex tile)
| Check whether the current owner owns the stuff on the given tile.
void | MarkTileDirtyByTile (TileIndex tile)
| Mark a tile given by its index dirty for repaint.
void | ShowCostOrIncomeAnimation (int x, int y, int z, Money cost)
void | ShowFeederIncomeAnimation (int x, int y, int z, Money cost)
void | AskExitGame ()
void | AskExitToGameMenu ()
void | RedrawAutosave ()
int | ttd_main (int argc, char *argv[])
void | HandleExitGameRequest ()

## Detailed Description

Some generic functions that actually shouldn't be here.

Definition in file functions.h.

## Function Documentation

bool CheckOwnership | ( | Owner | owner,
|  | TileIndex | tile |
| ) |  |  |

Check whether the current owner owns something.

If that isn't the case an appropriate error will be given.

Parameters:

  | owner | the owner of the thing to check.
  | tile | optional tile to get the right town.

Precondition:
  if tile == 0 then the owner can't be OWNER_TOWN.

Returns:
  true iff it's owned by the current company.

Definition at line 251 of file company_cmd.cpp.

References GetNameOfOwner(), OWNER_END, and OWNER_TOWN.

Referenced by CanRemoveRoadWithStop(), CheckAllowRemoveRoad(), CmdAutofillTimetable(), CmdAutoreplaceVehicle(), CmdBuildRoad(), CmdBuildRoadStop(), CmdChangeServiceInt(), CmdChangeTimetable(), CmdCloneOrder(), CmdCloneVehicle(), CmdDeleteOrder(), CmdForceTrainProceed(), CmdInsertOrder(), CmdModifyOrder(), CmdMoveOrder(), CmdMoveRailVehicle(), CmdOrderRefit(), CmdRefitAircraft(), CmdRefitRailVehicle(), CmdRefitRoadVeh(), CmdRefitShip(), CmdRenameStation(), CmdRenameVehicle(), CmdRenameWaypoint(), CmdRestoreOrderIndex(), CmdReverseTrainDirection(), CmdSellAircraft(), CmdSellRailWagon(), CmdSellRoadVeh(), CmdSellShip(), CmdSetTimetableStart(), CmdSetVehicleOnTime(), CmdSkipToOrder(), CmdStartStopVehicle(), CmdTurnRoadVeh(), IsValidTileForWaypoint(), RemoveAirport(), RemoveDock(), RemoveFromRailBaseStation(), RemoveRailStation(), and RemoveRoadStop().

bool CheckTileOwnership | ( | TileIndex | tile | ) |

Check whether the current owner owns the stuff on the given tile.

If that isn't the case an appropriate error will be given.

Parameters:

  | tile | the tile to check.

Returns:
  true iff it's owned by the current company.

Definition at line 269 of file company_cmd.cpp.

References GetNameOfOwner(), GetTileOwner(), and OWNER_END.

Referenced by CmdBuildSingleRail(), CmdBuildSingleSignal(), CmdConvertRail(), CmdRemoveSingleRail(), CmdRemoveSingleSignal(), and CmdSellLandArea().