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 () |
Some generic functions that actually shouldn't be here.
Definition in file functions.h.
bool CheckCompanyHasMoney | ( | CommandCost & | cost | ) |
Verify whether the company can pay the bill.
cost | [inout] Money to pay, is changed to an error if the company does not have enough money. |
true
if the company has enough money, else it returns false
. Definition at line 184 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 | |||
) |
Check whether the current owner owns something.
If that isn't the case an appropriate error will be given.
owner | the owner of the thing to check. | |
tile | optional tile to get the right town. |
Definition at line 289 of file company_cmd.cpp.
References GetNameOfOwner(), OWNER_END, OWNER_TOWN, and return_cmd_error.
Referenced by CanRemoveRoadWithStop(), CheckAllowRemoveRoad(), CheckAllowRemoveTunnelBridge(), CheckFlatLandRoadStop(), CmdAutofillTimetable(), CmdAutoreplaceVehicle(), CmdBuildRoad(), CmdChangeServiceInt(), CmdChangeTimetable(), CmdCloneOrder(), CmdCloneVehicle(), CmdDeleteOrder(), CmdForceTrainProceed(), CmdInsertOrder(), CmdModifyOrder(), CmdMoveOrder(), CmdMoveRailVehicle(), CmdOrderRefit(), CmdRefitVehicle(), CmdRenameStation(), CmdRenameVehicle(), CmdRenameWaypoint(), CmdReverseTrainDirection(), CmdSellVehicle(), CmdSetTimetableStart(), CmdSetVehicleOnTime(), CmdSkipToOrder(), CmdStartStopVehicle(), CmdTurnRoadVeh(), IsValidTileForWaypoint(), RemoveAirport(), RemoveDock(), RemoveFromRailBaseStation(), RemoveRailStation(), RemoveRoadStop(), and Vehicle::SendToDepot().
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.
tile | the tile to check. |
Definition at line 307 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 | ) |
Subtract money from the _current_company, if the company is valid.
cost | Money to pay. |
Definition at line 231 of file company_cmd.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), and SubtractMoneyFromAnyCompany().
Referenced by CmdGiveMoney(), CompaniesGenStatistics(), CompaniesPayInterest(), DoCommand(), and DoCommandPInternal().
void SubtractMoneyFromCompanyFract | ( | CompanyID | company, | |
CommandCost | cst | |||
) |
Subtract money from a company, including the money fraction.
company | Company paying the bill. | |
cst | Cost of a command. |
Definition at line 242 of file company_cmd.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), CommandCost::GetCost(), CommandCost::GetExpensesType(), CompanyProperties::money_fraction, and SubtractMoneyFromAnyCompany().
Referenced by Train::OnNewDay(), Ship::OnNewDay(), RoadVehicle::OnNewDay(), and Aircraft::OnNewDay().