station_func.h

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef STATION_FUNC_H
00013 #define STATION_FUNC_H
00014 
00015 #include "sprite.h"
00016 #include "rail_type.h"
00017 #include "road_type.h"
00018 #include "vehicle_type.h"
00019 #include "economy_func.h"
00020 #include "rail.h"
00021 
00022 void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius);
00023 
00024 void FindStationsAroundTiles(const TileArea &location, StationList *stations);
00025 
00026 void ShowStationViewWindow(StationID station);
00027 void UpdateAllStationVirtCoords();
00028 
00029 CargoArray GetProductionAroundTiles(TileIndex tile, int w, int h, int rad);
00030 CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, uint32 *always_accepted = NULL);
00031 
00032 void UpdateStationAcceptance(Station *st, bool show_msg);
00033 
00034 const DrawTileSprites *GetStationTileLayout(StationType st, byte gfx);
00035 void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image);
00036 
00037 bool HasStationInUse(StationID station, bool include_company, CompanyID company);
00038 
00039 void DeleteOilRig(TileIndex t);
00040 
00041 /* Check if a rail station tile is traversable. */
00042 bool IsStationTileBlocked(TileIndex tile);
00043 
00044 bool CanStationTileHavePylons(TileIndex tile);
00045 bool CanStationTileHaveWires(TileIndex tile);
00046 
00047 void UpdateAirportsNoise();
00048 
00049 bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset);
00050 
00051 void IncreaseStats(Station *st, const Vehicle *v, StationID next_station_id);
00052 void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint capacity, uint usage);
00053 
00054 void DeleteStaleFlows(StationID at, CargoID c_id, StationID to);
00055 
00061 static inline Money StationMaintenanceCost(uint32 num)
00062 {
00063   return (_price[PR_INFRASTRUCTURE_STATION] * num * (1 + IntSqrt(num))) >> 7; // 7 bits scaling.
00064 }
00065 
00066 Money AirportMaintenanceCost(Owner owner);
00067 
00068 #endif /* STATION_FUNC_H */