src/track_func.h
changeset 9799 c91afc4512fe
parent 9784 a9cc0dff1667
equal deleted inserted replaced
9798:4b8cdc1adf4b 9799:c91afc4512fe
   588 	 * always overlap unless they are lower & upper or right & left. */
   588 	 * always overlap unless they are lower & upper or right & left. */
   589 	return bits != TRACK_BIT_HORZ && bits != TRACK_BIT_VERT;
   589 	return bits != TRACK_BIT_HORZ && bits != TRACK_BIT_VERT;
   590 }
   590 }
   591 
   591 
   592 /**
   592 /**
       
   593  * Check if a given track is contained within or overlaps some other tracks.
       
   594  *
       
   595  * @param tracks Tracks to be testet against
       
   596  * @param track The track to test
       
   597  * @return true if the track is already in the tracks or overlaps the tracks.
       
   598  */
       
   599 static inline bool TrackOverlapsTracks(TrackBits tracks, Track track)
       
   600 {
       
   601 	if (HasBit(tracks, track)) return true;
       
   602 	return TracksOverlap(tracks | TrackToTrackBits(track));
       
   603 }
       
   604 
       
   605 /**
   593  * Checks whether the trackdir means that we are reversing.
   606  * Checks whether the trackdir means that we are reversing.
   594  * @param dir the trackdir to check
   607  * @param dir the trackdir to check
   595  * @return true if it is a reversing road trackdir
   608  * @return true if it is a reversing road trackdir
   596  */
   609  */
   597 static inline bool IsReversingRoadTrackdir(Trackdir dir)
   610 static inline bool IsReversingRoadTrackdir(Trackdir dir)