summaryrefslogtreecommitdiff
path: root/src/road.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/road.cpp')
-rw-r--r--src/road.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/road.cpp b/src/road.cpp
index 4142f0bfa..dd5641823 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -36,6 +36,12 @@ static bool IsPossibleCrossing(const TileIndex tile, Axis ax)
GetFoundationSlope(tile, NULL) == SLOPE_FLAT);
}
+/**
+ * Clean up unneccesary RoadBits of a planed tile.
+ * @param tile current tile
+ * @param org_rb planed RoadBits
+ * @return optimised RoadBits
+ */
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
{
if (!IsValidTile(tile)) return ROAD_NONE;
@@ -91,6 +97,12 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
return org_rb;
}
+/**
+ * Finds out, whether given company has all given RoadTypes available
+ * @param company ID of company
+ * @param rts RoadTypes to test
+ * @return true if company has all requested RoadTypes available
+ */
bool HasRoadTypesAvail(const CompanyID company, const RoadTypes rts)
{
RoadTypes avail_roadtypes;
@@ -105,11 +117,21 @@ bool HasRoadTypesAvail(const CompanyID company, const RoadTypes rts)
return (rts & ~avail_roadtypes) == 0;
}
+/**
+ * Validate functions for rail building.
+ * @param rt road type to check.
+ * @return true if the current company may build the road.
+ */
bool ValParamRoadType(const RoadType rt)
{
return HasRoadTypesAvail(_current_company, RoadTypeToRoadTypes(rt));
}
+/**
+ * Get the road types the given company can build.
+ * @param company the company to get the roadtypes for.
+ * @return the road types.
+ */
RoadTypes GetCompanyRoadtypes(CompanyID company)
{
RoadTypes rt = ROADTYPES_NONE;