(svn r3898) Add functions to find a bridge end starting at a middle tile

This commit is contained in:
tron
2006-03-16 05:28:15 +00:00
parent ca1efd3189
commit ec33376fa3
3 changed files with 46 additions and 15 deletions

View File

@@ -15,6 +15,12 @@ static inline bool IsBridgeRamp(TileIndex t)
return !HASBIT(_m[t].m5, 6);
}
static inline bool IsBridgeMiddle(TileIndex t)
{
return HASBIT(_m[t].m5, 6);
}
/**
* Get the direction pointing onto the bridge
@@ -28,6 +34,12 @@ static inline DiagDirection GetBridgeRampDirection(TileIndex t)
}
static inline Axis GetBridgeAxis(TileIndex t)
{
return (Axis)GB(_m[t].m5, 0, 1);
}
static inline bool IsClearUnderBridge(TileIndex t)
{
return GB(_m[t].m5, 3, 3) == 0;
@@ -45,6 +57,17 @@ static inline TransportType GetTransportTypeUnderBridge(TileIndex t)
}
/**
* Finds the end of a bridge in the specified direction starting at a middle tile
*/
TileIndex GetBridgeEnd(TileIndex, DiagDirection);
/**
* Finds the southern end of a bridge starting at a middle tile
*/
TileIndex GetSouthernBridgeEnd(TileIndex t);
/**
* Starting at one bridge end finds the other bridge end
*/