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)
 Verify whether the company can pay the bill.
void SubtractMoneyFromCompany (CommandCost cost)
 Subtract money from the _current_company, if the company is valid.
void SubtractMoneyFromCompanyFract (CompanyID company, CommandCost cost)
 Subtract money from a company, including the money fraction.
CommandCost CheckOwnership (Owner owner, TileIndex tile=0)
 Check whether the current owner owns something.
CommandCost 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 ()
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 CheckCompanyHasMoney ( CommandCost cost  ) 

Verify whether the company can pay the bill.

Parameters:
cost [inout] Money to pay, is changed to an error if the company does not have enough money.
Returns:
Function returns true if the company has enough money, else it returns false.

Definition at line 188 of file company_cmd.cpp.

References CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), CommandCost::MakeError(), CompanyProperties::money, and SetDParam().

Referenced by CmdCloneVehicle(), DoCommand(), and DoCommandPInternal().

CommandCost CheckOwnership ( Owner  owner,
TileIndex  tile 
)
CommandCost 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:
A succeeded command iff it's owned by the current company, else a failed command.

Definition at line 321 of file company_cmd.cpp.

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

Referenced by CheckAllowRemoveTunnelBridge(), CmdBuildSingleRail(), CmdBuildSingleSignal(), CmdConvertRail(), CmdRemoveSingleRail(), CmdRemoveSingleSignal(), CmdRenameDepot(), and RemoveLock().

void SubtractMoneyFromCompany ( CommandCost  cost  ) 
void SubtractMoneyFromCompanyFract ( CompanyID  company,
CommandCost  cst 
)

Generated on Sun Jan 23 01:49:14 2011 for OpenTTD by  doxygen 1.6.1