#include "stdafx.h"
#include "openttd.h"
#include "rail_map.h"
#include "road_map.h"
#include "water_map.h"
#include "genworld.h"
#include "company_func.h"
#include "company_base.h"
#include "engine_base.h"
#include "date_func.h"
#include "landscape.h"
Go to the source code of this file.
Functions | |
static bool | IsPossibleCrossing (const TileIndex tile, Axis ax) |
Return if the tile is a valid tile for a crossing. | |
RoadBits | CleanUpRoadBits (const TileIndex tile, RoadBits org_rb) |
Clean up unneccesary RoadBits of a planed tile. | |
bool | HasRoadTypesAvail (const CompanyID company, const RoadTypes rts) |
Finds out, whether given company has all given RoadTypes available. | |
bool | ValParamRoadType (const RoadType rt) |
Validate functions for rail building. | |
RoadTypes | GetCompanyRoadtypes (CompanyID company) |
Get the road types the given company can build. |
Definition in file road.cpp.
Clean up unneccesary RoadBits of a planed tile.
tile | current tile | |
org_rb | planed RoadBits |
Definition at line 39 of file road.cpp.
References CountBits(), DIAGDIR_BEGIN, DIAGDIR_END, DiagDirToAxis(), DiagDirToRoadBits(), GetAnyRoadBits(), GetTileType(), IsPossibleCrossing(), IsValidTile(), IsWater(), MirrorRoadBits(), MP_CLEAR, MP_RAILWAY, MP_ROAD, MP_STATION, MP_TREES, MP_TUNNELBRIDGE, MP_WATER, ROAD_NONE, ROADTYPE_ROAD, ROADTYPE_TRAM, and TileAddByDiagDir().
Referenced by GrowTownInTile().
Get the road types the given company can build.
company | the company to get the roadtypes for. |
Definition at line 112 of file road.cpp.
References _date, _settings_game, EngineInfo::climates, DAYS_IN_YEAR, EF_ROAD_TRAM, GameSettings::game_creation, HasBit(), GameCreationSettings::landscape, EngineInfo::misc_flags, ROADTYPE_ROAD, ROADTYPE_TRAM, ROADTYPES_NONE, SetBit(), and VEH_ROAD.
Referenced by DoStartupNewCompany().
Finds out, whether given company has all given RoadTypes available.
company | ID of company | |
rts | RoadTypes to test |
Definition at line 93 of file road.cpp.
References IsGeneratingWorld(), OWNER_TOWN, and ROADTYPES_ROAD.
Referenced by CmdBuildBridge(), CmdBuildRoadStop(), CmdBuildTunnel(), AIRoad::IsRoadTypeAvailable(), and ValParamRoadType().
Return if the tile is a valid tile for a crossing.
tile | the curent tile | |
ax | the axis of the road over the rail |
Definition at line 31 of file road.cpp.
References AXIS_X, GetFoundationSlope(), GetRailTileType(), GetTrackBits(), IsTileType(), MP_RAILWAY, RAIL_TILE_NORMAL, SLOPE_FLAT, TRACK_BIT_X, and TRACK_BIT_Y.
Referenced by CleanUpRoadBits().
bool ValParamRoadType | ( | const RoadType | rt | ) |
Validate functions for rail building.
rt | road type to check. |
Definition at line 107 of file road.cpp.
References HasRoadTypesAvail(), and RoadTypeToRoadTypes().
Referenced by CmdBuildLongRoad(), CmdBuildRoad(), and CmdBuildRoadDepot().