OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

station_func.h
Go to the documentation of this file.
1 /* $Id: station_func.h 26549 2014-05-01 14:50:52Z fonsinchen $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef STATION_FUNC_H
13 #define STATION_FUNC_H
14
15 #include "sprite.h"
16 #include "rail_type.h"
17 #include "road_type.h"
18 #include "vehicle_type.h"
19 #include "economy_func.h"
20 #include "rail.h"
21 #include "linkgraph/linkgraph_type.h"
22
23 void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius);
24
25 void FindStationsAroundTiles(const TileArea &location, StationList *stations);
26
27 void ShowStationViewWindow(StationID station);
28 void UpdateAllStationVirtCoords();
29
30 CargoArray GetProductionAroundTiles(TileIndex tile, int w, int h, int rad);
31 CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, uint32 *always_accepted = NULL);
32
33 void UpdateStationAcceptance(Station *st, bool show_msg);
34
35 const DrawTileSprites *GetStationTileLayout(StationType st, byte gfx);
36 void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image);
37
38 bool HasStationInUse(StationID station, bool include_company, CompanyID company);
39
40 void DeleteOilRig(TileIndex t);
41
42 /* Check if a rail station tile is traversable. */
43 bool IsStationTileBlocked(TileIndex tile);
44
45 bool CanStationTileHavePylons(TileIndex tile);
46 bool CanStationTileHaveWires(TileIndex tile);
47
48 void UpdateAirportsNoise();
49
50 bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset);
51
52 void IncreaseStats(Station *st, const Vehicle *v, StationID next_station_id);
53 void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint capacity, uint usage, EdgeUpdateMode mode);
54 void RerouteCargo(Station *st, CargoID c, StationID avoid, StationID avoid2);
55
61 static inline Money StationMaintenanceCost(uint32 num)
62 {
63 return (_price[PR_INFRASTRUCTURE_STATION] * num * (1 + IntSqrt(num))) >> 7; // 7 bits scaling.
64 }
65
66 Money AirportMaintenanceCost(Owner owner);
67
68 #endif /* STATION_FUNC_H */